package com.tmfu.action;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.tmfu.entity.User;
import com.tmfu.service.IUserService;
@Controller
@RequestMapping("/user")
public class UserAction {
@Resource(name="userServiceImpl")
private IUserService userservice;
@RequestMapping(value = "/log.do", method = RequestMethod.POST)
public String Login(User user,ModelMap mp){
User us=userservice.user(user);
if(us!=null){
if(us.getUname().equals(user.getUname())&&us.getPassword().equals(user.getPassword())){}
mp.addAttribute("jg", "登陆成功!");
return "/content/index";
}else{
mp.addAttribute("jg", "登陆失败!");
return "/content/index";
}
}
@RequestMapping(value = "/reg.do", method = RequestMethod.POST)
public String Register(User user,ModelMap mp){
userservice.reg(user);
User us=userservice.user(user);
if(us!=null){
mp.addAttribute("zjg", "注册成功!");
return "/content/index";
}else{
mp.addAttribute("zjg", "注册失败!");
return "/content/index";
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
maven+spring-mvc+spring+mybatis简单的登陆注册,让你更加快速上手
共42个文件
xml:11个
java:6个
class:6个
5星 · 超过95%的资源 需积分: 14 454 下载量 107 浏览量
2014-05-05
08:58:44
上传
评论 5
收藏 52KB ZIP 举报
温馨提示
代码简单明了,用最简单的登陆注册,展示spring-mvc+mybatis+maven几个技术的用法。
资源推荐
资源详情
资源评论
收起资源包目录
tianfu.zip (42个子文件)
tianfu
pom.xml 7KB
target
test-classes
m2e-wtp
web-resources
META-INF
maven
com.tianfu.test
tianfu
pom.xml 710B
pom.properties 220B
Tianfu
tianfushop
pom.xml 7KB
pom.properties 215B
MANIFEST.MF 103B
classes
log4j.properties 2KB
com
tmfu
dao
IUserDao.class 442B
xml
UserDaoMapper.xml 844B
action
UserAction.class 2KB
common
gongkai.class 278B
service
IUserService.class 228B
impl
UserServiceImpl.class 1KB
entity
User.class 1KB
app.xml 4KB
mybatis.xml 2KB
.settings
org.eclipse.m2e.core.prefs 90B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.project.facet.core.xml 252B
org.eclipse.core.resources.prefs 57B
org.eclipse.wst.common.component 743B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.validation.prefs 50B
.jsdtscope 575B
org.eclipse.jdt.core.prefs 664B
src
test
java
main
webapp
css
images
WEB-INF
content
index.jsp 5KB
web.xml 2KB
uploads
js
jquery.js 54KB
index.jsp 591B
error.jsp 584B
resources
log4j.properties 2KB
app.xml 4KB
mybatis.xml 2KB
java
com
tmfu
dao
xml
UserDaoMapper.xml 844B
IUserDao.java 294B
action
UserAction.java 1KB
common
gongkai.java 57B
service
IUserService.java 148B
impl
UserServiceImpl.java 781B
entity
User.java 957B
.project 1KB
.classpath 1KB
共 42 条
- 1
jbzhjyp
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页