使用spring的mvc,实现用户的登陆和显示。只是个简单得例子,仅供想学习springmvc得程序员入门之用。
1.开发环境:eclipse 3.2 + jdk1.5+tomcat5.5+spring2.0
2.使用的jar包:
3. 开发过程
(1)新建一个web工程,目录结构如下:
(2)用户信息保持的javabean(User.java)的代码:
(3)index.jsp的代码:
(4)web.xml的代码:
(5)springapp-servlet.xml的代码:
(6)hello.jsp的代码:
(7)display.jsp代码:
(8)跳转的两个controller的代码:
SpringappController.java
SpringappDisController.java的代码: