问一下在web.xml中配置<url-pattern>*.do</url-pattern>为什么在requestMapping中可不加.do
问一下在web.xml中配置<url-pattern>*.do</url-pattern>为什么在requestMapping中可不加.doweb.xml中配置<url-...
问一下在web.xml中配置<url-pattern>*.do</url-pattern>为什么在requestMapping中可不加.do
web.xml中配置<url-pattern>*.do</url-pattern>
假设页面请求 http:localhost:8080/index.do
springmvc拦截请求
controller:
@requestMapping("index")
public String index(){
return "index";
}
请问springMVC中是如何将实现映射的(controller中不是应该也写@requestMapping("index.do")吗) 展开
web.xml中配置<url-pattern>*.do</url-pattern>
假设页面请求 http:localhost:8080/index.do
springmvc拦截请求
controller:
@requestMapping("index")
public String index(){
return "index";
}
请问springMVC中是如何将实现映射的(controller中不是应该也写@requestMapping("index.do")吗) 展开
2个回答
2018-09-09 · 知道合伙人互联网行家
关注
展开全部
指定特定后缀名的mime类型,好让该后缀名的文件被安全传输到客户端.
配置的示例:
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>application/msexcel</mime-type>
</mime-mapping>
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>zip</extension>
<mime-type>application/zip</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rar</extension>
<mime-type>application/rar</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>application/txt</mime-type>
</mime-mapping>
<mime-mapping>
<extension>chm</extension>
<mime-type>application/mshelp</mime-type>
</mime-mapping>
配置的示例:
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>application/msexcel</mime-type>
</mime-mapping>
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>zip</extension>
<mime-type>application/zip</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rar</extension>
<mime-type>application/rar</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>application/txt</mime-type>
</mime-mapping>
<mime-mapping>
<extension>chm</extension>
<mime-type>application/mshelp</mime-type>
</mime-mapping>
追问
你这个好像不是我要的答案哎
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询