package com.ssm.controller;
import java.io.UnsupportedEncodingException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.ssm.model.Employee;
import com.ssm.service.EmployeeService;
@Controller("/log")
public class EmployeeController {
@Autowired
private EmployeeService empBiz;
//跳转到登录
@RequestMapping("toLog")
public ModelAndView toLog() {
return new ModelAndView("log");
}
//登录
@RequestMapping("log")
public ModelAndView log(HttpServletRequest request,String username,String password) throws Exception{
request.setCharacterEncoding("utf-8");
Employee employee = new Employee();
employee.setUsername(username);
employee.setUserpwd(password);
List<Employee> list = empBiz.selectDenglu(employee);
if(list.size()>0){
return new ModelAndView("loginSuccess");
}else{
return new ModelAndView("log");
}
}
//跳转到注册
@RequestMapping("toAdd")
public ModelAndView toAdd() {
return new ModelAndView("zhuCe");
}
//注册
@RequestMapping("zhuCe")
public ModelAndView zhuCe(HttpServletRequest request,String username,String password) throws Exception{
request.setCharacterEncoding("utf-8");
Employee employee = new Employee();
employee.setUsername(username);
employee.setUserpwd(password);
int addls = empBiz.insertSelective(employee);
if(addls>0){
return new ModelAndView("zhuCeSuccess");
}else{
return new ModelAndView("zhuCe");
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
jyw.zip_SSM框架_Ssm添加用户_ssm jar_ssm 注册_ssm怎么写添加
共64个文件
xml:14个
jsp:6个
css:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 188 浏览量
2022-09-14
23:42:24
上传
评论
收藏 448KB ZIP 举报
温馨提示
ssm框架下的用户添加注册,这里面包括jar等,只要配置好数据库就可以使用了
资源推荐
资源详情
资源评论
收起资源包目录
jyw.zip (64个子文件)
jyw
pom.xml 5KB
target
test-classes
m2e-wtp
web-resources
META-INF
maven
cn.jbit
jyw
pom.xml 5KB
pom.properties 194B
MANIFEST.MF 115B
classes
conf
mybatis-config.xml 519B
spring-mybatis.xml 3KB
spring-mvc.xml 2KB
jdbc.properties 379B
log4j.properties 1KB
spring.xml 750B
com
ssm
model
Employee.class 1KB
mapper
EmployeeMapper.class 508B
controller
EmployeeController.class 2KB
service
EmployeeService.class 511B
imple
EmployeeServiceImple.class 1KB
mapping
EmployeeMapper.xml 3KB
.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.wst.common.component 734B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.validation.prefs 50B
.jsdtscope 639B
org.eclipse.jdt.core.prefs 430B
src
test
java
main
webapp
css
bootstrap-theme.css 26KB
bootstrap.css.map 380KB
bootstrap.min.css 118KB
bootstrap-theme.min.css.map 25KB
bootstrap.css 143KB
bootstrap-theme.min.css 23KB
bootstrapValidator.min.css 694B
bootstrap-theme.css.map 47KB
bootstrap.min.css.map 529KB
WEB-INF
web.xml 3KB
jsp
zhuCeSuccess.jsp 379B
log.jsp 2KB
loginSuccess.jsp 361B
login.jsp 3KB
zhuCe.jsp 2KB
fonts
glyphicons-halflings-regular.woff 23KB
glyphicons-halflings-regular.woff2 18KB
glyphicons-halflings-regular.ttf 44KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.svg 106KB
js
npm.js 484B
bootstrap.min.js 36KB
jquery-1.11.2.min.js 94KB
bootstrapValidator.min.js 108KB
bootstrap.js 68KB
index.jsp 57B
resources
conf
mybatis-config.xml 519B
spring-mybatis.xml 3KB
spring-mvc.xml 2KB
jdbc.properties 379B
log4j.properties 1KB
spring.xml 750B
mapping
EmployeeMapper.xml 3KB
java
com
ssm
model
Employee.java 834B
mapper
EmployeeMapper.java 398B
controller
EmployeeController.java 2KB
service
EmployeeService.java 385B
imple
EmployeeServiceImple.java 1KB
.project 1KB
.classpath 1KB
共 64 条
- 1
资源评论
小波思基
- 粉丝: 70
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功