该用户从未签到
|
- <?xml version="1.0" encoding="UTF-8"?>
% O" G5 N$ @$ A* n - <beans 3 X: Q- F E" q9 b8 E
- xmlns="http://www.springframework.org/schema/beans"
& Q" a0 G* c# \5 s: H4 S$ n v - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
k3 @4 F$ F! N - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
9 p1 D$ C c: f) e -
5 S2 w! X! i, b! s7 h7 |. D - <bean id="loginController" class="com.spring.web.controller.LoginController"/> ! k# f X' r" K2 B
-
& U( \1 S! E6 c" ? -
2 r* Q5 q8 y5 n$ O - <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
- d& f6 x. ]7 z4 q! R# x) f- E; } - <!-- 配置方法一
+ P8 \- e" Y5 s% ~ - <property name="urlMap">
' ~( z! j% E/ f6 ^& ? - <map> : u0 h& s2 e1 |, p, g: {
- <entry key="/user/login.do" value-ref="loginController"/> 8 Z# ]+ M; q$ L
- </map> ( n& O* ~ M) C. s& L/ l( G
- </property> --> % G- r5 [: }" r% j. X+ h
- <!-- 配置方法二
/ B' g2 B0 y* _3 I. y - <property name="mappings">
9 A6 c! v1 Q- @6 H- M6 t - <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean"> 8 T3 D6 P9 e; i2 M1 E+ ?
- <property name="location"> ( p4 C! y( @, z# L% B
- <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! -->
9 N- E& e+ z4 f# e, [& ? - </property> . p" E1 H" ?, ?. C/ ~/ d% K. P
- </bean>
' z( g! _" m- d: c+ v( _, e1 _ - </property> : Q. {7 U9 J1 o4 ?
- --> ' z1 E4 c! [; y; \8 v% D
- <!-- 配置方法三 -->
( J# ?! T. Z% V% x; i% h' b - <property name="mappings"> % _3 i; B% q2 {6 H# p
- <props>
+ |8 ^5 {- @$ O - <prop key="/user/login.do">loginController</prop>
6 I+ N9 }+ I8 a* r N% u - </props>
& E0 H) `$ E. e$ _! y/ [/ ] - </property></bean> 4 k1 a0 f7 f3 a' l
-
3 e0 Q& `( w' w! r" N8 f - <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> ! d/ a( ^3 Z5 N: E9 a1 \. R
- <property name="prefix"><value>/WEB-INF/jsp/</value></property>
2 O B& X) H) W4 F% B - <property name="suffix"><value>.jsp</value></property> ; I5 s) \' T! M' R3 a9 L+ \
- <property name="viewClass">
# U. `4 L4 t1 t5 f7 t, n7 G% y - <value>
3 \6 {' Y6 q: x. h - org.springframework.web.servlet.view.JstlView
+ J- q, J! b o1 M4 W8 l& i5 |& F - </value>
7 h/ r3 C, k) v) W - </property> # n) E8 @8 m& a
- </bean>
% R" F+ p [% }9 M/ ^7 Z - </beans> # m6 d8 q6 u& o, c) d
复制代码 springMvc简单的登录程序小项目 :http://www.52itstyle.top/thread-2737-1-1.html0 K$ Q3 T l: Z0 @
|
|