springmvc在web.xml配置路径后缀
来源:互联网 发布:js deepCopy 编辑:程序博客网 时间:2024/05/16 23:52
若想在springmvc里配置路径后缀,如demoControoler/test.htm 若以.htm为结尾的后缀 , 也可是其他后缀比如:(.do .action)
1.web.xml配置
<servlet>
<servlet-name>springMvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:servlet-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMvc</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
2.spring-mvc.xml配置
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager"/>
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="favorPathExtension" value="false" />
<property name="favorParameter" value="false" />
<property name="ignoreAcceptHeader" value="false" />
<property name="mediaTypes" >
<value>
atom=application/atom+xml;charset=UTF-8
html=text/html;charset=UTF-8
json=application/json;charset=UTF-8
*=*/*;charset=UTF-8
</value>
</property>
</bean>
<context:component-scan base-package="com.demo" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
- springmvc在web.xml配置路径后缀
- springMvc在web.xml文件的配置
- springmvc在web.xml中的常用配置
- SpringMVC web.xml配置
- SpringMVC web.xml配置
- 在web.xml中配置SpringMVC的启动配置项
- springMVC的配置文件名在web.xml中如何定义
- spring 和springmvc 在 web.xml中的配置
- 在web.xml中配置,使用配置类替代springmvc.xml和applicationContext.xml
- springmvc之web.xml配置
- web.xml配置,基于SpringMVC
- SpringMVC的web.xml配置
- 容易出问题的Struts2在web.xml路径拦截配置
- servlet在web.xml中的路径配置的映射
- 如何在web.xml中配置jsp的访问路径
- web.xml 指定配置路径
- springmvc web.xml spring-servlet.xml 配置
- SpringMVC中在web.xml中配置DispatcherServlet与中文乱码配置
- 搭建linux系统下的solr服务器
- 网络流模板(费用流/可行流/上下界)
- 堆排序
- Apache Zookeeper 快速入门及API基础CRUD操作
- Spring容器中的Bean几种初始化方法和销毁方法的先后顺序
- springmvc在web.xml配置路径后缀
- 【剑指offer】 重建二叉树
- Android 中使用 RecyclerView + SnapHelper 实现类似 ViewPager 效果
- mysql因机器断电以后启动报错的问题
- 适配android6.0:运行时权限检查机制
- a标签click事件
- Your password has expired. To log in you must change it using a client that supports expired passwor
- Java中“>> 右移”;“<< 左移”无符号右移>>>;“
- 轮询(Ajax)和(long)