该用户从未签到
|
- <?xml version="1.0" encoding="UTF-8"?> 2 x; [+ L* u7 }- p: `4 ]
- <beans # d! S( ?; @& Q' f
- xmlns="http://www.springframework.org/schema/beans"
8 \5 t) T: e4 v2 S+ ?+ J# V - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
/ O4 p' |- q/ i0 K/ G - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> ( o- p% P$ F2 |3 e
- 5 j# k- w0 u I, d
- <bean id="loginController" class="com.spring.web.controller.LoginController"/>
3 K8 G) o$ b! v: E -
/ f! o! w$ k2 a: n$ ?8 q2 e1 _9 H - ! C; z* O, U+ u; H: c
- <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
8 R& h7 q5 ^4 b - <!-- 配置方法一
2 ?: W7 @! r/ ~+ N - <property name="urlMap">
- _ }0 g- L5 j( H - <map>
* M4 O) m) \# {) M - <entry key="/user/login.do" value-ref="loginController"/> 2 s6 i9 ?6 W) X0 K7 N; l: ]/ N$ z
- </map> . ?' f5 R0 g& H' l" ]6 K
- </property> -->
" }% ]! \, U4 B% O) s/ A; O# q - <!-- 配置方法二
) Z( i! Z2 r3 ^3 q# V7 Z. V - <property name="mappings">
' X0 `& }7 f0 R4 z( e/ O$ L4 @8 X5 z - <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean"> ( x6 Y0 i' w" e. O- p
- <property name="location"> + _3 U: S6 K+ L' E) P: o- W
- <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! --> ; W8 E8 E1 T7 w- i6 S
- </property>
( X7 N% U: J3 C& }" W - </bean> ' R s' X" Z' I& W, D9 D2 k% V
- </property>
6 x6 o" @; h+ P3 M$ c- o8 L8 } - --> 4 X) s1 H: {0 G9 l) }- o
- <!-- 配置方法三 -->
1 D- q5 ^1 g3 F- h - <property name="mappings"> 1 F7 V; C( N2 E& u
- <props>
; ]& Y _9 H4 B - <prop key="/user/login.do">loginController</prop> 7 b0 O' h9 Z5 t$ x8 @7 N1 C& e
- </props>
- P* U$ c0 n0 u ?) K( T6 h - </property></bean>
: Y9 r3 s; i9 { ^ - 3 a1 R, W1 W5 E8 O
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> . r; Q5 @' [7 Y4 V
- <property name="prefix"><value>/WEB-INF/jsp/</value></property>
' L/ f: c/ q- c( Q - <property name="suffix"><value>.jsp</value></property> 3 p$ J) G( c& f/ R- j h
- <property name="viewClass">
% |3 ]. F$ N! l( \& |2 E* T' r - <value> 4 k6 q& q( `" |( X/ `% y5 z+ C. ~
- org.springframework.web.servlet.view.JstlView
1 c; B; g' P7 M$ U( I1 N3 m( Z - </value> ( } h) o8 H0 J7 [) p/ Y
- </property>
9 }4 _+ G/ e, I" F2 l" b& X! m - </bean> * G) H; M/ L0 \* G6 K: s
- </beans>
3 r: j' ~3 K5 P9 k+ \7 ]) ^
复制代码 springMvc简单的登录程序小项目 :http://www.52itstyle.top/thread-2737-1-1.html" j$ L( O, t# @3 a' w, Z3 f2 D5 |4 c
|
|