资源简介
一个简答的Web登录程序基于struts2+Hibernate 方便struts2+Hibernate入门使用
代码片段和文件信息
package com.dream.action;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.dream.dao.UserDao;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport{
/**Login登录Action
*
*/
private static final long serialVersionUID = 1L;
public String execute() throws Exception {
System.out.print(“有人登陆\n“);
HttpServletRequest request = ServletActionContext.getRequest();
String username = (String) request.getParameter(“username“);
String password = (String) request.getParameter(“password“);
System.out.println(“账号:“+username);
if (username.isEmpty() || password.isEmpty()){
return ERROR;
}else {
if(new UserDao().login(username password)) {
return SUCCESS;
}
else
{
return ERROR;
}
}
}
}
相关资源
- SSH框架搭建综合项目案例
- 基于SSH框架的员工管理系统
- ExtJS 6.2 实战
- 图书馆管理系统界面
- 达内DMS数据采集系统
- Practical Statistics for Data Scientist
- 基于SpringMVC+Maven开发网上书城系统
- 植物大战僵尸h5+js
- 奖助学金贷款信息管理系统
- 深入浅出nodejs 最新版
- 聊天室源代码struts2+spring+hibernate
- mxgraph开发包
- 比特币白皮书中文版
- swt org.sf.feeling.swt.win32.extension_1.1.0_S
- SpringMVC+Echarts 读取后台数据进行图标
- 《Spring微服务实战》中文高清版
- 旅游社交后台管理系统241543
- Badminton.zip
- SSM框架实现多文件上传,框架可以直
- OnlineTestSystem.7z
- ssm-crud(spring+springmvc+mybatis)
- 修改代码的艺术(working effectively wi
- 学生毕业设计-宿舍管理系统设计与实
- SSM的一个简单,增删改查都有
- 酒店推荐系统.zip
- Refactoring_Improving_the_Design_of_Existing_C
- IntelliJ IDEA2018.2中文汉化包
- 消消乐A2版源码和演示视频.rar
- SSM框架管理系统
- 基于web的酒店客房管理系统
评论
共有 条评论