<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="loginController" class="com.spring.web.controller.LoginController"/> <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <!-- 配置方法一 <property name="urlMap"> <map> <entry key="/user/login.do" value-ref="loginController"/> </map> </property> --> <!-- 配置方法二 <property name="mappings"> <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="location"> <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! --> </property> </bean> </property> --> <!-- 配置方法三 --> <property name="mappings"> <props> <prop key="/user/login.do">loginController</prop> </props> </property></bean> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix"><value>/WEB-INF/jsp/</value></property> <property name="suffix"><value>.jsp</value></property> <property name="viewClass"> <value> org.springframework.web.servlet.view.JstlView </value> </property> </bean> </beans>
详细解决方案
Spring Web MVC 的HandlerMapping的施用之-SimpleUrlHandlerMapping(有三种配法)
热度:252 发布时间:2012-09-13 09:51:52.0
相关解决方案
- Spring MVC开发模式,怎么取得新增的id
- spring 表单对象绑定有关问题 String与Long的转换
- spring+quartz定时器有关问题
- spring @Scope("prototype")注解更新有关问题,寻求帮助
- Spring MVC是不是可以完全取代Struts
- spring+quartz的错误,不能正常启动
- spring mvc +ibatis+db2连接数据库的配置如何写啊小弟我链接不下
- spring MVC cvc-complex-type.2.4.c解决方案
- Spring + Mybatis 组合报错
- Spring 中 packagesToScan有关问题
- Spring MVC中点击旋钮没反应
- spring aop这个跳转异常是咋回事
- spring security3的一个小疑点。加急
- spring 事务 aop transactionManager,该怎么解决
- Spring 事务管理,该怎么处理
- 关于 Spring 声明式事务管理!解决办法
- Struts2+Spring+JPA+FREEMARKER 登录程序异常
- 关于 Spring 宣言式事务管理!
- 求SSM分页 struts +spring+mybatis 给小弟我发个学习学习吧 多谢大神们
- spring placeholderConfig的有关问题
- spring 事宜 aop transactionManager
- Spring 事务管理,该怎么解决
- struts2 + spring 整合有关问题
- struts+spring+mybatis出现错误(java.lang.ClassNotFoundException: Entity)为提示位置
- 求解 struts+spring+mybatis sqlsession为空 debug发现没有执行set方法 检查配置好像没有关问题
- 新手求教。spring+axis2集成的有关问题。The endpoint reference (EPR) for the Operation not found
- Spring 和 hibernate如何配置事物
- hibernate与此同时使用多数据源?spring+hibernate
- Spring 动态代理,该怎么解决
- cfx Spring 跟 Spring MVC一起用报错