|
该用户从未签到
|
- <?xml version="1.0" encoding="UTF-8"?> 4 {2 D) T8 y# E" R* i
- <beans 4 v. o w" s6 R
- xmlns="http://www.springframework.org/schema/beans" / a3 U+ K4 n7 ^0 m% Z
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
' H2 E0 D! Y3 {$ _, Y# {+ W4 j - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> % c' s8 m7 }# O. B
- 1 p2 S/ K; d" V
- <bean id="loginController" class="com.spring.web.controller.LoginController"/> # k) N8 @7 G9 m' h& V
- 4 f+ g& M, N/ y" S
- $ U$ v0 {4 w1 }, D0 N4 _! \
- <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 9 x. ^ u$ y$ V' b, v- u
- <!-- 配置方法一
) z7 z' _( p5 q. Q) Y - <property name="urlMap">
h( ?6 s6 M) U - <map>
7 U* m) h% X8 x - <entry key="/user/login.do" value-ref="loginController"/>
: D7 C2 g- j1 w% h4 n8 i8 [' M - </map> $ l) ]5 P$ b3 [! c
- </property> -->
4 F0 Q3 a3 E$ W4 v% V3 r - <!-- 配置方法二
* ~6 G. N0 Z# a6 } - <property name="mappings">
+ `' ?; S1 `4 v - <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
9 N3 r, z4 B- ? - <property name="location">
8 M: v+ B+ e2 q. r+ @1 Y - <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! -->
5 r# [0 w, H, j% ^. \) i - </property> ' c; q9 V; T3 J
- </bean>
. f& _) L4 c- G! J- g2 N - </property> , C O) V* W. d
- -->
L; _$ H9 c( X - <!-- 配置方法三 -->
1 b" Z3 I( Q: l$ A/ v* c& s - <property name="mappings"> 2 q2 _2 w$ ?5 |: }
- <props>
4 S1 H9 c, x1 H9 w6 O _' x) M& \ - <prop key="/user/login.do">loginController</prop> : _( a- ~1 H0 g" N4 N
- </props> + @0 {/ q$ p. L# F' y
- </property></bean> 6 ^/ ~, y" w: |1 C
- 5 z0 G7 L% Y& f
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> $ M( }% |2 f% A+ h2 i" B; C+ I, z
- <property name="prefix"><value>/WEB-INF/jsp/</value></property>
6 M6 ^ u' V" p+ ~ ^& D, h/ R' U) ] - <property name="suffix"><value>.jsp</value></property> + c4 S. P3 R0 s: d% B2 B0 H
- <property name="viewClass"> j) n* _0 l( X6 Y8 X3 R j0 I
- <value>
! {4 J& @! R" m& u - org.springframework.web.servlet.view.JstlView 4 f; E7 c0 n% x% ?
- </value> : ~5 _! S5 x" L5 X$ T
- </property>
1 N# ~5 O3 s( Z* k2 x3 s o) G - </bean>
2 C s4 I3 M: e- }& j8 V6 r - </beans>
6 W3 U' m- @* x8 D1 h0 C- n: J* E
复制代码 springMvc简单的登录程序小项目 :http://www.52itstyle.top/thread-2737-1-1.html1 j. E x/ v/ |$ b$ ~% }
|
|