该用户从未签到
|
- <?xml version="1.0" encoding="UTF-8"?>
) G$ ^* E/ d' s; S' P' T K4 s - <beans
, Y4 y/ c: h4 c5 _- X0 R - xmlns="http://www.springframework.org/schema/beans"
- O( k5 v$ [* `8 U2 j - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 R( b% C& j; e( B$ d8 l3 N* D - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> 0 }5 B5 B+ Y2 L7 C8 L, K
-
2 P& X0 v7 n8 L9 x - <bean id="loginController" class="com.spring.web.controller.LoginController"/>
7 }( F9 X. \" T m% s5 g - ! ?! p+ s# T" k/ e9 I3 ~/ J9 c$ K/ ?
- ' W' ]" D+ A% m3 B. B
- <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> ' s' e' k: ~. Z$ Y- b' x, b
- <!-- 配置方法一 7 ^6 Z5 v6 U' S/ a5 a9 ~
- <property name="urlMap"> 6 E. X) z3 u. _' n, z0 I, a6 x4 V2 q
- <map>
9 J6 f* w$ b* g2 V0 N% l: N' z - <entry key="/user/login.do" value-ref="loginController"/>
! V' |6 H6 R) j6 K( V - </map>
) |7 [' R L% O3 F+ e& M - </property> --> * ?5 ~, Q' x2 `8 }
- <!-- 配置方法二
, v% @4 ]& U1 `0 z B P, j - <property name="mappings"> " @' {0 Q% ~" c1 I! u/ U. }7 R
- <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean"> ! l. W! H" b0 n. e( M
- <property name="location"> 2 ~* z! o+ U+ Z& w) e/ C% J0 g
- <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! -->
. D3 K. c/ {1 w7 K- e# T- u - </property>
: P L9 l( g% d- o6 Y- s* b9 Z - </bean>
. i9 n. m* E7 k4 |+ V9 P% f - </property> |3 R0 w4 a; e2 V
- --> ! P- Y L. E, x6 F, o' S
- <!-- 配置方法三 --> & ^* @5 U1 h/ @
- <property name="mappings">
/ _$ b% }! L3 b7 e6 r - <props>
0 Y- Q) @2 u9 U2 k7 I* | - <prop key="/user/login.do">loginController</prop> . y3 [) a8 j5 v# g
- </props>
# A" M: J( W; e) l2 V2 c - </property></bean> ?& k5 l0 H. r- A5 M0 u
- % v9 B s6 [0 R/ x7 y) P3 U
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
4 w# y/ @7 k# f; H) x( u0 ?. H - <property name="prefix"><value>/WEB-INF/jsp/</value></property> o2 U# J( a% H, i8 V, G$ K
- <property name="suffix"><value>.jsp</value></property>
- |, c+ E" Y4 z) U - <property name="viewClass"> 3 `9 A' ?. q/ _ a
- <value>
' F& [- ]0 C: y& g - org.springframework.web.servlet.view.JstlView
4 q4 C) E' U: v$ F - </value>
+ Y- i- X. V/ [4 h: o% D0 ^; n6 [- [ - </property>
; t8 P0 T1 l2 K4 J8 J5 ^ - </bean>
2 t9 J: O- I+ L$ i6 D9 Y( v - </beans>
/ E i' O6 g' B n
复制代码 springMvc简单的登录程序小项目 :http://www.52itstyle.top/thread-2737-1-1.html
1 n' D, x$ l6 _1 @1 p9 H |
|