{"id":551,"date":"2023-09-16T06:27:38","date_gmt":"2023-06-11T08:02:50","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/index.php\/2023\/11\/30\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/"},"modified":"2025-08-02T17:41:04","modified_gmt":"2025-08-02T09:41:04","slug":"spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/","title":{"rendered":"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3"},"content":{"rendered":"<p>\u6587\u4ef6\u4e0a\u4f20\u662f\u4efb\u4f55Web\u5e94\u7528\u4e2d\u975e\u5e38\u5e38\u89c1\u7684\u4efb\u52a1\u3002\u6211\u4eec\u4e4b\u524d\u5df2\u7ecf\u5b66\u4e60\u4e86\u5982\u4f55\u5728Servlet\u548cStruts2\u4e2d\u4e0a\u4f20\u6587\u4ef6\u3002\u4eca\u5929\u6211\u4eec\u5c06\u5b66\u4e60Spring\u6587\u4ef6\u4e0a\u4f20\uff0c\u5177\u4f53\u6765\u8bf4\u662fSpring MVC\u6587\u4ef6\u4e0a\u4f20\u7528\u4e8e\u5355\u4e2a\u548c\u591a\u4e2a\u6587\u4ef6\u3002<\/p>\n<h2>Spring MVC \u6587\u4ef6\u4e0a\u4f20<\/h2>\n<p>Spring MVC\u6846\u67b6\u901a\u8fc7\u96c6\u6210Apache Commons FileUpload API\u63d0\u4f9b\u4e86\u5bf9\u6587\u4ef6\u4e0a\u4f20\u7684\u652f\u6301\u3002\u4e0a\u4f20\u6587\u4ef6\u7684\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u8fdb\u884c\u7b80\u5355\u7684\u914d\u7f6e\u3002\u6211\u4eec\u5c06\u5728STS\u4e2d\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Spring MVC\u9879\u76ee\uff0c\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\u3002\u5176\u4e2d\u5927\u90e8\u5206\u662f\u7531STS\u5de5\u5177\u751f\u6210\u7684\u6837\u677f\u4ee3\u7801\uff0c\u6211\u4eec\u5c06\u91cd\u70b9\u5173\u6ce8\u9700\u8981\u8fdb\u884c\u7684\u66f4\u6539\uff0c\u4ee5\u5229\u7528Spring\u6587\u4ef6\u4e0a\u4f20\u96c6\u6210\u529f\u80fd\u3002<\/p>\n<h3>Apache Commons FileUpload\u7684Maven\u4f9d\u8d56<\/h3>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5728\u6211\u4eec\u7684pom.xml\u6587\u4ef6\u4e2d\u6dfb\u52a0Apache Commons FileUpload\u7684\u4f9d\u8d56\u9879\uff0c\u4ee5\u4fbf\u6240\u9700\u7684jar\u6587\u4ef6\u6210\u4e3aWeb\u5e94\u7528\u7a0b\u5e8f\u7684\u4e00\u90e8\u5206\u3002\u4ee5\u4e0b\u662f\u6211pom.xml\u6587\u4ef6\u4e2d\u7684\u4f9d\u8d56\u9879\u4ee3\u7801\u7247\u6bb5\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;!-- Apache Commons FileUpload --&gt; \r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;commons-fileupload&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;commons-fileupload&lt;\/artifactId&gt;\r\n\t&lt;version&gt;1.3.1&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n\r\n&lt;!-- Apache Commons IO --&gt; \r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;commons-io&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;commons-io&lt;\/artifactId&gt;\r\n\t&lt;version&gt;2.4&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n<\/code><\/pre>\n<h3>Spring\u6587\u4ef6\u4e0a\u4f20\u8868\u5355\u89c6\u56fe<\/h3>\n<p>\u6211\u4eec\u5c06\u521b\u5efa\u4e24\u4e2aJSP\u9875\u9762\uff0c\u5728Spring Web\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5b9e\u73b0\u5355\u6587\u4ef6\u548c\u591a\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u3002upload.jsp\u89c6\u56fe\u4ee3\u7801\uff1a<\/p>\n<pre class=\"post-pre\"><code>&lt;%@ taglib uri=\"https:\/\/java.sun.com\/jsp\/jstl\/core\" prefix=\"c\" %&gt;\r\n&lt;%@ page session=\"false\" %&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;\u6587\u4ef6\u4e0a\u4f20\u8bf7\u6c42\u9875\u9762&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;form method=\"POST\" action=\"uploadFile\" enctype=\"multipart\/form-data\"&gt;\r\n\t\t\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\uff1a&lt;input type=\"file\" name=\"file\"&gt;&lt;br \/&gt; \r\n\t\t\u6587\u4ef6\u540d\uff1a&lt;input type=\"text\" name=\"name\"&gt;&lt;br \/&gt; &lt;br \/&gt; \r\n\t\t&lt;input type=\"submit\" value=\"\u4e0a\u4f20\"&gt; \u70b9\u51fb\u6b64\u5904\u4e0a\u4f20\u6587\u4ef6\uff01\r\n\t&lt;\/form&gt;\t\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<p>\u4e0a\u4f20\u591a\u4e2a\u6587\u4ef6\u7684JSP\u9875\u9762\u4ee3\u7801\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;%@ taglib uri=\"https:\/\/java.sun.com\/jsp\/jstl\/core\" prefix=\"c\" %&gt;\r\n&lt;%@ page session=\"false\" %&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;\u591a\u6587\u4ef6\u4e0a\u4f20\u8bf7\u6c42\u9875\u9762&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;form method=\"POST\" action=\"uploadMultipleFile\" enctype=\"multipart\/form-data\"&gt;\r\n\t\t\u8981\u4e0a\u4f20\u7684\u6587\u4ef61\uff1a&lt;input type=\"file\" name=\"file\"&gt;&lt;br \/&gt; \r\n\t\t\u6587\u4ef6\u540d1\uff1a&lt;input type=\"text\" name=\"name\"&gt;&lt;br \/&gt; &lt;br \/&gt; \r\n\t\t\u8981\u4e0a\u4f20\u7684\u6587\u4ef62\uff1a&lt;input type=\"file\" name=\"file\"&gt;&lt;br \/&gt; \r\n\t\t\u6587\u4ef6\u540d2\uff1a&lt;input type=\"text\" name=\"name\"&gt;&lt;br \/&gt; &lt;br \/&gt;\r\n\t\t&lt;input type=\"submit\" value=\"\u4e0a\u4f20\"&gt; \u70b9\u51fb\u6b64\u5904\u4e0a\u4f20\u6587\u4ef6\uff01\r\n\t&lt;\/form&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<p>\u6ce8\u610f\u8fd9\u4e9b\u6587\u4ef6\u662f\u7b80\u5355\u7684HTML\u6587\u4ef6\uff0c\u6211\u6ca1\u6709\u4f7f\u7528\u4efb\u4f55JSP\u6216Spring\u6807\u8bb0\u4ee5\u907f\u514d\u590d\u6742\u6027\u3002\u9700\u8981\u6ce8\u610f\u7684\u91cd\u8981\u4e00\u70b9\u662f\u8868\u5355\u7684enctype\u5e94\u8be5\u662fmultipart\/form-data\uff0c\u8fd9\u6837Spring Web\u5e94\u7528\u7a0b\u5e8f\u624d\u77e5\u9053\u8bf7\u6c42\u5305\u542b\u9700\u8981\u5904\u7406\u7684\u6587\u4ef6\u6570\u636e\u3002\u8fd8\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5bf9\u4e8e\u591a\u4e2a\u6587\u4ef6\uff0c\u8f93\u5165\u5b57\u6bb5\u4e2d\u7684\u8868\u5355\u5b57\u6bb5&#8221;file&#8221;\u548c&#8221;name&#8221;\u662f\u76f8\u540c\u7684\uff0c\u8fd9\u6837\u6570\u636e\u5c06\u4ee5\u6570\u7ec4\u7684\u5f62\u5f0f\u53d1\u9001\u3002\u6211\u4eec\u5c06\u63d0\u53d6\u8f93\u5165\u6570\u7ec4\u5e76\u89e3\u6790\u6587\u4ef6\u6570\u636e\u5e76\u5c06\u5176\u5b58\u50a8\u5728\u7ed9\u5b9a\u7684\u6587\u4ef6\u540d\u4e2d\u3002<\/p>\n<h3>Spring MVC \u591a\u90e8\u5206\u914d\u7f6e<\/h3>\n<p>\u8fd9\u662f\u6587\u7ae0\u300aSpring MVC\u6587\u4ef6\u4e0a\u4f20\u793a\u4f8b\u6559\u7a0b &#8211; \u5355\u4e2a\u548c\u591a\u4e2a\u6587\u4ef6\u300b\u7684\u7b2c2\u90e8\u5206\uff08\u51713\u90e8\u5206\uff09\u3002<\/p>\n<p>\u4e3a\u4e86\u5229\u7528Apache Commons FileUpload\u5904\u7406\u591a\u90e8\u5206\u8bf7\u6c42\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5c06multipartResolver bean\u914d\u7f6e\u4e3a\u7c7borg.springframework.web.multipart.commons.CommonsMultipartResolver\u3002\u6211\u4eec\u6700\u7ec8\u7684Spring\u914d\u7f6e\u6587\u4ef6\u5982\u4e0b\u6240\u793a\u3002servlet-context.xml\u4ee3\u7801\uff1a<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;beans:beans xmlns=\"https:\/\/www.springframework.org\/schema\/mvc\"\r\n\txmlns:xsi=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns:beans=\"https:\/\/www.springframework.org\/schema\/beans\"\r\n\txmlns:context=\"https:\/\/www.springframework.org\/schema\/context\"\r\n\txsi:schemaLocation=\"https:\/\/www.springframework.org\/schema\/mvc https:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd\r\n\t\thttps:\/\/www.springframework.org\/schema\/beans https:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd\r\n\t\thttps:\/\/www.springframework.org\/schema\/context https:\/\/www.springframework.org\/schema\/context\/spring-context.xsd\"&gt;\r\n\r\n\t&lt;!-- DispatcherServlet Context: defines this servlet's request-processing \r\n\t\tinfrastructure --&gt;\r\n\r\n\t&lt;!-- Enables the Spring MVC @Controller programming model --&gt;\r\n\t&lt;annotation-driven \/&gt;\r\n\r\n\t&lt;!-- Handles HTTP GET requests for \/resources\/** by efficiently serving \r\n\t\tup static resources in the ${webappRoot}\/resources directory --&gt;\r\n\t&lt;resources mapping=\"\/**\" location=\"\/\" \/&gt;\r\n\r\n\t&lt;!-- Resolves views selected for rendering by @Controllers to .jsp resources \r\n\t\tin the \/WEB-INF\/views directory --&gt;\r\n\t&lt;beans:bean\r\n\t\tclass=\"org.springframework.web.servlet.view.InternalResourceViewResolver\"&gt;\r\n\t\t&lt;beans:property name=\"prefix\" value=\"\/WEB-INF\/views\/\" \/&gt;\r\n\t\t&lt;beans:property name=\"suffix\" value=\".jsp\" \/&gt;\r\n\t&lt;\/beans:bean&gt;\r\n\r\n\t&lt;beans:bean id=\"multipartResolver\"\r\n\t\tclass=\"org.springframework.web.multipart.commons.CommonsMultipartResolver\"&gt;\r\n\r\n\t\t &lt;!-- setting maximum upload size --&gt;\r\n\t\t&lt;beans:property name=\"maxUploadSize\" value=\"100000\" \/&gt;\r\n\r\n\t&lt;\/beans:bean&gt;\r\n\r\n\t&lt;context:component-scan base-package=\"com.Olivia.spring.controller\" \/&gt;\r\n\r\n&lt;\/beans:beans&gt;\r\n<\/code><\/pre>\n<p>\u8bf7\u6ce8\u610f\uff0c\u6211\u901a\u8fc7\u4e3amultipartResolver bean\u63d0\u4f9bmaxUploadSize\u5c5e\u6027\u503c\u6765\u8bbe\u7f6e\u6700\u5927\u4e0a\u4f20\u5927\u5c0f\u9650\u5236\u3002\u5982\u679c\u4f60\u67e5\u770bDispatcherServlet\u7c7b\u7684\u6e90\u4ee3\u7801\uff0c\u4f60\u4f1a\u53d1\u73b0\u5728\u4e0b\u9762\u7684\u65b9\u6cd5\u4e2d\u5b9a\u4e49\u5e76\u521d\u59cb\u5316\u4e86\u4e00\u4e2a\u540d\u4e3amultipartResolver\u7684MultipartResolver\u53d8\u91cf\u3002<\/p>\n<pre class=\"post-pre\"><code>private void initMultipartResolver(ApplicationContext context)\r\n  {\r\n    try\r\n    {\r\n      this.multipartResolver = ((MultipartResolver)context.getBean(\"multipartResolver\", MultipartResolver.class));\r\n      if (this.logger.isDebugEnabled()) {\r\n        this.logger.debug(\"Using MultipartResolver [\" + this.multipartResolver + \"]\");\r\n      }\r\n    }\r\n    catch (NoSuchBeanDefinitionException ex)\r\n    {\r\n      this.multipartResolver = null;\r\n      if (this.logger.isDebugEnabled())\r\n        this.logger.debug(\"Unable to locate MultipartResolver with name 'multipartResolver': no multipart request handling provided\");\r\n    }\r\n  }\r\n<\/code><\/pre>\n<p>\u4f7f\u7528\u8fd9\u4e2a\u914d\u7f6e\uff0c\u4efb\u4f55\u4ee5multipart\/form-data\u4f5c\u4e3aenctype\u7684\u8bf7\u6c42\u5c06\u5728\u4f20\u9012\u7ed9Controller\u7c7b\u4e4b\u524d\u7531multipartResolver\u5904\u7406\u3002<\/p>\n<h3>Spring\u6587\u4ef6\u4e0a\u4f20\u63a7\u5236\u5668\u7c7b<\/h3>\n<h2>Spring MVC\u6587\u4ef6\u4e0a\u4f20\u63a7\u5236\u5668\u5b9e\u73b0<\/h2>\n<p>\u63a7\u5236\u5668\u7c7b\u7684\u4ee3\u7801\u975e\u5e38\u7b80\u5355\uff0c\u6211\u4eec\u9700\u8981\u4e3auploadFile\u548cuploadMultipleFile URI\u5b9a\u4e49\u5904\u7406\u65b9\u6cd5\u3002FileUploadController.java\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"post-pre\"><code>package com.Olivia.spring.controller;\r\n\r\nimport java.io.BufferedOutputStream;\r\nimport java.io.File;\r\nimport java.io.FileOutputStream;\r\n\r\nimport org.slf4j.Logger;\r\nimport org.slf4j.LoggerFactory;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.bind.annotation.ResponseBody;\r\nimport org.springframework.web.multipart.MultipartFile;\r\n\r\n\/**\r\n * \u5904\u7406\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u4e0a\u4f20\u8bf7\u6c42\r\n *\/\r\n@Controller\r\npublic class FileUploadController {\r\n\r\n\tprivate static final Logger logger = LoggerFactory\r\n\t\t\t.getLogger(FileUploadController.class);\r\n\r\n\t\/**\r\n\t * \u4f7f\u7528Spring\u63a7\u5236\u5668\u4e0a\u4f20\u5355\u4e2a\u6587\u4ef6\r\n\t *\/\r\n\t@RequestMapping(value = \"\/uploadFile\", method = RequestMethod.POST)\r\n\tpublic @ResponseBody\r\n\tString uploadFileHandler(@RequestParam(\"name\") String name,\r\n\t\t\t@RequestParam(\"file\") MultipartFile file) {\r\n\r\n\t\tif (!file.isEmpty()) {\r\n\t\t\ttry {\r\n\t\t\t\tbyte[] bytes = file.getBytes();\r\n\r\n\t\t\t\t\/\/ \u521b\u5efa\u5b58\u50a8\u6587\u4ef6\u7684\u76ee\u5f55\r\n\t\t\t\tString rootPath = System.getProperty(\"catalina.home\");\r\n\t\t\t\tFile dir = new File(rootPath + File.separator + \"tmpFiles\");\r\n\t\t\t\tif (!dir.exists())\r\n\t\t\t\t\tdir.mkdirs();\r\n\r\n\t\t\t\t\/\/ \u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u6587\u4ef6\r\n\t\t\t\tFile serverFile = new File(dir.getAbsolutePath()\r\n\t\t\t\t\t\t+ File.separator + name);\r\n\t\t\t\tBufferedOutputStream stream = new BufferedOutputStream(\r\n\t\t\t\t\t\tnew FileOutputStream(serverFile));\r\n\t\t\t\tstream.write(bytes);\r\n\t\t\t\tstream.close();\r\n\r\n\t\t\t\tlogger.info(\"\u670d\u52a1\u5668\u6587\u4ef6\u4f4d\u7f6e=\"\r\n\t\t\t\t\t\t+ serverFile.getAbsolutePath());\r\n\r\n\t\t\t\treturn \"\u60a8\u6210\u529f\u4e0a\u4f20\u4e86\u6587\u4ef6=\" + name;\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\treturn \"\u60a8\u4e0a\u4f20\u5931\u8d25 \" + name + \" => \" + e.getMessage();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn \"\u60a8\u4e0a\u4f20\u5931\u8d25 \" + name\r\n\t\t\t\t\t+ \" \u56e0\u4e3a\u6587\u4ef6\u4e3a\u7a7a\u3002\";\r\n\t\t}\r\n\t}\r\n\r\n\t\/**\r\n\t * \u4f7f\u7528Spring\u63a7\u5236\u5668\u4e0a\u4f20\u591a\u4e2a\u6587\u4ef6\r\n\t *\/\r\n\t@RequestMapping(value = \"\/uploadMultipleFile\", method = RequestMethod.POST)\r\n\tpublic @ResponseBody\r\n\tString uploadMultipleFileHandler(@RequestParam(\"name\") String[] names,\r\n\t\t\t@RequestParam(\"file\") MultipartFile[] files) {\r\n\r\n\t\tif (files.length != names.length)\r\n\t\t\treturn \"\u7f3a\u5c11\u5fc5\u8981\u4fe1\u606f\";\r\n\r\n\t\tString message = \"\";\r\n\t\tfor (int i = 0; i < files.length; i++) {\r\n\t\t\tMultipartFile file = files[i];\r\n\t\t\tString name = names[i];\r\n\t\t\ttry {\r\n\t\t\t\tbyte[] bytes = file.getBytes();\r\n\r\n\t\t\t\t\/\/ \u521b\u5efa\u5b58\u50a8\u6587\u4ef6\u7684\u76ee\u5f55\r\n\t\t\t\tString rootPath = System.getProperty(\"catalina.home\");\r\n\t\t\t\tFile dir = new File(rootPath + File.separator + \"tmpFiles\");\r\n\t\t\t\tif (!dir.exists())\r\n\t\t\t\t\tdir.mkdirs();\r\n\r\n\t\t\t\t\/\/ \u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u6587\u4ef6\r\n\t\t\t\tFile serverFile = new File(dir.getAbsolutePath()\r\n\t\t\t\t\t\t+ File.separator + name);\r\n\t\t\t\tBufferedOutputStream stream = new BufferedOutputStream(\r\n\t\t\t\t\t\tnew FileOutputStream(serverFile));\r\n\t\t\t\tstream.write(bytes);\r\n\t\t\t\tstream.close();\r\n\r\n\t\t\t\tlogger.info(\"\u670d\u52a1\u5668\u6587\u4ef6\u4f4d\u7f6e=\"\r\n\t\t\t\t\t\t+ serverFile.getAbsolutePath());\r\n\r\n\t\t\t\tmessage = message + \"\u60a8\u6210\u529f\u4e0a\u4f20\u4e86\u6587\u4ef6=\" + name\r\n\t\t\t\t\t\t+ \"<br \/>\";\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\treturn \"\u60a8\u4e0a\u4f20\u5931\u8d25 \" + name + \" => \" + e.getMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn message;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<p>\u6ce8\u610f\u5230\u4f7f\u7528\u4e86Spring\u7684\u6ce8\u89e3\u4f7f\u6211\u4eec\u7684\u5de5\u4f5c\u66f4\u8f7b\u677e\uff0c\u5e76\u4e14\u4ee3\u7801\u66f4\u6613\u8bfb\u3002uploadFileHandler\u65b9\u6cd5\u7528\u4e8e\u5904\u7406\u5355\u4e2a\u6587\u4ef6\u4e0a\u4f20\u573a\u666f\uff0c\u800cuploadMultipleFileHandler\u65b9\u6cd5\u7528\u4e8e\u5904\u7406\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u573a\u666f\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u5355\u4e00\u7684\u65b9\u6cd5\u6765\u5904\u7406\u8fd9\u4e24\u79cd\u60c5\u51b5\u3002\u73b0\u5728\u5c06\u5e94\u7528\u7a0b\u5e8f\u5bfc\u51fa\u4e3aWAR\u6587\u4ef6\uff0c\u5e76\u90e8\u7f72\u5230Tomcat Servlet\u5bb9\u5668\u4e2d\u3002\u5f53\u6211\u4eec\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u4e0b\u9762\u7684\u56fe\u50cf\u5c55\u793a\u4e86\u8bf7\u6c42\u548c\u54cd\u5e94\u60c5\u51b5\u3002<\/p>\n<h2>Spring MVC\u4e0a\u4f20\u6587\u4ef6\u793a\u4f8b<\/h2>\n<p>\u4f60\u53ef\u4ee5\u67e5\u770b\u670d\u52a1\u5668\u65e5\u5fd7\u6765\u4e86\u89e3\u6587\u4ef6\u5b58\u50a8\u7684\u4f4d\u7f6e\u3002\u4ece\u4e0a\u9762\u7684\u94fe\u63a5\u4e0b\u8f7d\u9879\u76ee\u5e76\u8bd5\u7740\u64cd\u4f5c\u4e00\u4e0b\uff0c\u4ee5\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n<h3>\u4e0b\u8f7dSpring\u6587\u4ef6\u4e0a\u4f20\u9879\u76ee<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u4ef6\u4e0a\u4f20\u662f\u4efb\u4f55Web\u5e94\u7528\u4e2d\u975e\u5e38\u5e38\u89c1\u7684\u4efb\u52a1\u3002\u6211\u4eec\u4e4b\u524d\u5df2\u7ecf\u5b66\u4e60\u4e86\u5982\u4f55\u5728Servlet\u548cStruts2\u4e2d\u4e0a\u4f20\u6587\u4ef6\u3002\u4eca [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1130,776,1615,1109,1614],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-java-web","tag-spring-mvc","tag-1615","tag-1109","tag-1614"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecdSpring MVC\u6846\u67b6\u4e2d\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u5355\u4e2a\u6587\u4ef6\u548c\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u7684\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\uff0c\u5e2e\u52a9Java\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u6587\u4ef6\u4e0a\u4f20\u6280\u672f\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc\u6587\u4ef6\u4e0a\u4f20\u793a\u4f8b\u6559\u7a0b-\u5355\u4e2a\u548c\u591a\u4e2a\u6587\u4ef6\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecdSpring MVC\u6846\u67b6\u4e2d\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u5355\u4e2a\u6587\u4ef6\u548c\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u7684\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\uff0c\u5e2e\u52a9Java\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u6587\u4ef6\u4e0a\u4f20\u6280\u672f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc\u6587\u4ef6\u4e0a\u4f20\u793a\u4f8b\u6559\u7a0b-\u5355\u4e2a\u548c\u591a\u4e2a\u6587\u4ef6\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-11T08:02:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-02T09:41:04+00:00\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/\",\"name\":\"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-06-11T08:02:50+00:00\",\"dateModified\":\"2025-08-02T09:41:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"description\":\"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecdSpring MVC\u6846\u67b6\u4e2d\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u5355\u4e2a\u6587\u4ef6\u548c\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u7684\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\uff0c\u5e2e\u52a9Java\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u6587\u4ef6\u4e0a\u4f20\u6280\u672f\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3 - Blog - Silicon Cloud","description":"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecdSpring MVC\u6846\u67b6\u4e2d\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u5355\u4e2a\u6587\u4ef6\u548c\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u7684\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\uff0c\u5e2e\u52a9Java\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u6587\u4ef6\u4e0a\u4f20\u6280\u672f\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc\u6587\u4ef6\u4e0a\u4f20\u793a\u4f8b\u6559\u7a0b-\u5355\u4e2a\u548c\u591a\u4e2a\u6587\u4ef6\/","og_locale":"zh_CN","og_type":"article","og_title":"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3","og_description":"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecdSpring MVC\u6846\u67b6\u4e2d\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u5355\u4e2a\u6587\u4ef6\u548c\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u7684\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\uff0c\u5e2e\u52a9Java\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u6587\u4ef6\u4e0a\u4f20\u6280\u672f\u3002","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc\u6587\u4ef6\u4e0a\u4f20\u793a\u4f8b\u6559\u7a0b-\u5355\u4e2a\u548c\u591a\u4e2a\u6587\u4ef6\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-11T08:02:50+00:00","article_modified_time":"2025-08-02T09:41:04+00:00","author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/","name":"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-06-11T08:02:50+00:00","dateModified":"2025-08-02T09:41:04+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"description":"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecdSpring MVC\u6846\u67b6\u4e2d\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u5355\u4e2a\u6587\u4ef6\u548c\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u7684\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\uff0c\u5e2e\u52a9Java\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u6587\u4ef6\u4e0a\u4f20\u6280\u672f\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Spring MVC\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6574\u6559\u7a0b\uff1a\u5355\u6587\u4ef6\u4e0e\u591a\u6587\u4ef6\u4e0a\u4f20\u5b9e\u4f8b\u8be6\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/spring-mvc%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%a4%ba%e4%be%8b%e6%95%99%e7%a8%8b-%e5%8d%95%e4%b8%aa%e5%92%8c%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":4,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":110251,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions\/110251"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}