该用户从未签到
|
- <?xml version="1.0" encoding="UTF-8"?> 9 J2 n. G: j# b
- <beans ; v: |) T& m$ n8 R- ? g0 P e
- xmlns="http://www.springframework.org/schema/beans"
/ u0 e7 S( M6 t6 t: w- K - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 v9 Q1 Y( p( y# g' d; x: v, P) E - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> # r) a6 K8 W% ?9 A: d
-
4 Q9 ]6 R" u! c- r) d9 R6 V& Y - <bean id="loginController" class="com.spring.web.controller.LoginController"/>
^$ K5 C1 `! f% J4 \, Q, ^3 G& Y -
8 k+ ~* i2 N2 f4 W- n) I5 T4 g/ z - 1 z2 W1 X& ^% C: E ]
- <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 5 ^. F4 d. n- B" V
- <!-- 配置方法一 ( z( a& h% e- A7 D/ @7 P4 Q# ?
- <property name="urlMap"> 3 g/ t$ t) d( Q2 O+ d8 F
- <map>
- \. J/ V# y9 k& K - <entry key="/user/login.do" value-ref="loginController"/> 2 _4 m2 x8 _% X$ [( W' y9 S* j
- </map>
; m: C0 t9 y1 Z" ~5 U - </property> -->
" G8 ?/ ~- a7 n$ Q$ L& Q - <!-- 配置方法二
1 \* c+ v, m) v- e: G3 g. E - <property name="mappings"> 9 K0 Z) X% Y: y: I; Z
- <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean"> 0 F) k. H8 e# n+ }7 \, M
- <property name="location"> 5 H1 w: o* @: K4 b; n# C
- <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! -->
' [+ q$ x( K* i* Y6 M - </property> * {1 ?. f' l6 z- z4 Y5 _/ J! ]
- </bean>
: P( A8 l' |. T8 R7 C" Y7 m7 Z - </property>
8 |* l. K, B1 X* U, X& I$ E( x - -->
' Q7 o/ x1 U. N% | - <!-- 配置方法三 -->
3 Y" ~# d, G O) T - <property name="mappings">
1 K" ?7 z1 O% @: i+ v4 Y1 p7 P r - <props>
2 b+ w* E7 q9 v& ? j2 D& O' d6 E - <prop key="/user/login.do">loginController</prop> ) g0 _2 q! O* |1 R6 J9 ^
- </props>
2 |4 s6 f( M$ E: r - </property></bean> 1 {0 T. q, m! } c. Q) |5 G
-
4 m# ], ?3 v4 P7 ^( v' K - <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 5 c5 P& u/ u. C$ r1 K
- <property name="prefix"><value>/WEB-INF/jsp/</value></property> 1 j. g& U( L5 N, K
- <property name="suffix"><value>.jsp</value></property> * b& ?0 n7 A7 {6 r
- <property name="viewClass"> 6 ~. I5 Q1 B5 H N$ {8 }4 l
- <value>
% L! M' s& Z' A) @5 I0 C - org.springframework.web.servlet.view.JstlView
$ b2 C2 H& n$ }2 Z5 \ - </value>
5 s2 Z2 l' }$ v5 k - </property> / g0 U2 X, ~! l( G, @* R- |
- </bean>
/ U6 {5 ?: s* d/ N1 b$ H - </beans>
6 G# l) {! Z0 @! m1 Z
复制代码 springMvc简单的登录程序小项目 :http://www.52itstyle.top/thread-2737-1-1.html
; S6 _- `, t. [! t' C( O |
|