该用户从未签到
|
- <?xml version="1.0" encoding="UTF-8"?>
. {! c1 N' V2 `4 L O$ Q - <beans 4 l$ O# i+ ~/ h& d' H
- xmlns="http://www.springframework.org/schema/beans" - l- x& ~% T' p, a( y, F
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" , H& n+ I( I2 w6 f) Z! ^* @
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> 2 M) G5 D5 y6 Y
-
7 d: o( D& \2 O- r$ h" n/ e - <bean id="loginController" class="com.spring.web.controller.LoginController"/>
+ r; A5 s6 p. G$ k) F4 m' k' | - ' q5 a7 {4 F) M* }8 W1 J8 A) x( v
- ( l. P2 I; ?: F% E
- <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> ! r, ^6 Z6 P9 W7 o
- <!-- 配置方法一
1 X' e4 Y# q/ D2 S3 l5 L - <property name="urlMap">
5 G' w" y+ ^* s1 | - <map>
& B7 {) I( j( K3 ?+ ]1 p: h& T4 T - <entry key="/user/login.do" value-ref="loginController"/>
) W' B3 ~2 s# Z. k& m8 H" A4 ?) ^ - </map>
2 s6 w9 k: S/ w( I; G - </property> --> $ p T; w) K, Q
- <!-- 配置方法二 5 \9 r! ~- l! X+ t' E
- <property name="mappings"> / w+ b/ Y/ m$ {2 `3 A
- <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
% h' G; A i* g) j4 P' r - <property name="location"> / n |9 @- x" @; ?4 x* F U3 x
- <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! -->
. G7 |# J! c: E. A - </property> 8 Q! x* j! D# Q! c) l
- </bean>
3 L$ f9 M+ A2 k1 Z0 K7 w( M# t - </property>
- Y% j- a \3 h - -->
8 Q6 T: @8 W% C; _* Y$ F" E - <!-- 配置方法三 --> , s) @7 `( d: c) A# A
- <property name="mappings"> S, w" I+ Z* s
- <props> : T6 q& V- G- O, Z: |4 S
- <prop key="/user/login.do">loginController</prop> . R; [: ?) V9 R5 p
- </props> _, K& u: o0 o6 F5 |
- </property></bean>
% A' D3 f! T4 M - I5 c9 _+ I1 P0 ?' E( r# D
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
& }# ^( v0 b' w- c5 e+ r3 c - <property name="prefix"><value>/WEB-INF/jsp/</value></property>
, ~: l- p3 ^3 `3 \8 r. { - <property name="suffix"><value>.jsp</value></property> 5 d9 \+ W( `) l. |" h
- <property name="viewClass">
/ K9 v) b9 P! N, c' L W. l - <value> % g& i9 P w- w; N6 E2 F+ ]
- org.springframework.web.servlet.view.JstlView 0 ^; K6 I- g7 f& V; C
- </value>
! z) W9 Y# X! v& [1 m; a - </property>
8 g0 r5 Z9 x/ z2 r( q! m5 Y - </bean>
9 X& S( ?/ T5 F1 g/ S& I) ^( N - </beans> # r& Q! l' Y" j
复制代码 springMvc简单的登录程序小项目 :http://www.52itstyle.top/thread-2737-1-1.html
% P J5 G* v( a( ~* R |
|