package com.hisoft.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.hisoft.pojo.User;
@Controller
@RequestMapping("/user")
public class UserController {
@RequestMapping(value="/login")
public String login(HttpServletRequest request,
HttpServletResponse response,User userinfo)
{ // 非常方便可以直接在方法里面放入对象
String username=userinfo.getUsername();
String password=userinfo.getPassword();
if ((!"".equals(username)||""!=username)&&(!"".equals(password)||""!=password))
{
request.setAttribute("user", userinfo);
return "users/loginsucc"; //判断,将跳转不同的页面
}
else
{
request.setAttribute("message", "用户名和密码不能为空 !");
return "users/loginerr"; //判断,将跳转不同的页面
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
spring3login 登录代码 示例
共44个文件
jar:26个
jsp:3个
xml:3个
5星 · 超过95%的资源 需积分: 3 8 下载量 118 浏览量
2012-02-25
23:13:33
上传
评论
收藏 4.36MB RAR 举报
温馨提示
spring3login 登录代码 示例spring3login 登录代码 示例spring3login 登录代码 示例spring3login 登录代码 示例
资源推荐
资源详情
资源评论
收起资源包目录
spring3login.rar (44个子文件)
spring3login
.project 1KB
WebContent
WEB-INF
view
users
loginerr.jsp 459B
springmvc-servlet.xml 2KB
lib
servlet-api.jar 86KB
asm.jar 26KB
org.springframework.transaction-3.0.2.RELEASE.jar 226KB
org.springframework.web.servlet-3.0.2.RELEASE.jar 394KB
loginsucc.jsp 518B
org.springframework.core-3.0.2.RELEASE.jar 350KB
org.springframework.context.support-3.0.2.RELEASE.jar 98KB
org.springframework.instrument.tomcat-3.0.2.RELEASE.jar 5KB
org.springframework.orm-3.0.2.RELEASE.jar 325KB
org.springframework.asm-3.0.2.RELEASE.jar 52KB
org.springframework.context-3.0.2.RELEASE.jar 642KB
jstl.jar 20KB
org.springframework.test-3.0.2.RELEASE.jar 200KB
org.springframework.web.portlet-3.0.2.RELEASE.jar 169KB
org.springframework.jdbc-3.0.2.RELEASE.jar 369KB
org.springframework.web-3.0.2.RELEASE.jar 374KB
jsp-api.jar 75KB
org.springframework.web.struts-3.0.2.RELEASE.jar 31KB
org.springframework.oxm-3.0.2.RELEASE.jar 59KB
org.springframework.expression-3.0.2.RELEASE.jar 153KB
org.springframework.jms-3.0.2.RELEASE.jar 179KB
org.springframework.aop-3.0.2.RELEASE.jar 313KB
org.springframework.beans-3.0.2.RELEASE.jar 537KB
org.springframework.aspects-3.0.2.RELEASE.jar 29KB
standard.jar 384KB
commons-logging-1.0.4.jar 37KB
org.springframework.instrument-3.0.2.RELEASE.jar 2KB
web.xml 1KB
index.jsp 302B
META-INF
MANIFEST.MF 39B
src
com
hisoft
pojo
User.java 488B
controller
UserController.java 1KB
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 305B
org.eclipse.jdt.core.prefs 395B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 466B
.jsdtscope 503B
build
classes
com
hisoft
pojo
User.class 918B
controller
UserController.class 1KB
.classpath 586B
共 44 条
- 1
资源评论
- 海上东浦2012-06-26下载后感觉帮助不是很大,内容很多也很全面,不过有用的不多。
fjcsx1998
- 粉丝: 0
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功