该用户从未签到
|
- <?xml version="1.0" encoding="UTF-8"?>
1 J, t7 A$ ?8 |+ w/ |; D5 P- g( @+ a - <beans ' y. v: }7 C2 ]* E- m' s; S
- xmlns="http://www.springframework.org/schema/beans" - X# X+ N4 {) Z) g
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 8 c) a+ ]: v# z2 d6 I+ @/ x) k0 D& s
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> : W6 w/ S! F1 D, f0 W( i# q! v6 D+ o
- 7 t+ v- G. H' e' T
- <bean id="loginController" class="com.spring.web.controller.LoginController"/> 8 F# D* S+ R9 F+ R! B7 C
-
) e" i I* M3 b" ` - ) a- s1 A: a' g2 b F
- <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
* C7 J. n( h, F1 n - <!-- 配置方法一
: Q' [2 ], [3 |/ |8 F - <property name="urlMap"> 0 j) r9 |, t- l- Q. ~
- <map> / o# w( N$ o! n( _9 G& J3 Y/ p# w
- <entry key="/user/login.do" value-ref="loginController"/> . u& e: ? t5 T5 ], {4 g( F
- </map>
0 I7 \: ]( n2 B6 k J% V/ F - </property> --> + ]3 u: h" f' k( ~% i% J: A
- <!-- 配置方法二
- m& @/ I- @' B1 b, ]6 H - <property name="mappings">
; D1 m- {; o2 S; l' i5 q+ U$ x - <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
1 L. z2 E5 u7 y5 C# c" I Y - <property name="location">
$ K1 z& K8 p% ]7 d F9 u- C' q - <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! --> 7 J- H9 A1 u: N" ^4 g" Z& |6 A
- </property>
8 @) `2 h1 j8 \- C$ k1 g6 D. L - </bean>
, V" W. @1 M/ W( d' d- G - </property> 7 k6 P3 V: C3 Q. C
- --> 3 R: j. i# v4 R# ?
- <!-- 配置方法三 -->
! _0 {3 f% p" a6 f; [ - <property name="mappings">
: I) S5 a6 w2 Y- E( z' z - <props> 9 l4 Q" }3 }6 J; b
- <prop key="/user/login.do">loginController</prop> : J4 t2 |: B- H% J' i
- </props> x1 C% _ t7 N& Z
- </property></bean> . V& b+ B: n$ B7 J6 p
- 2 u. E- K2 ~0 X2 H# n; s- l5 R/ ]
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
) e: \: b" }* B( h6 ^6 h - <property name="prefix"><value>/WEB-INF/jsp/</value></property> , F$ A8 O9 d, M1 f0 ]
- <property name="suffix"><value>.jsp</value></property> / i5 k+ x; S' S! I3 c
- <property name="viewClass"> - N1 O6 C1 Z+ \% J6 [8 _8 H1 K$ v
- <value> : C; D/ X* g- ?7 h( @0 N
- org.springframework.web.servlet.view.JstlView
. `3 P, F% g1 ?5 \2 r4 Y - </value> : v; T7 @. O4 ] F5 w( }. `
- </property>
4 N/ H) n K7 t2 P& S* s7 Y& J4 `1 t - </bean> / p0 \) Y. Y2 t. `. a
- </beans> ( A. T4 D1 ^2 G7 B+ ^. ]& |
复制代码 springMvc简单的登录程序小项目 :http://www.52itstyle.top/thread-2737-1-1.html2 ?& b4 S& Z9 f
|
|