资源简介
简单实现注册登录功能。开发环境为eclipse,使用struts2框架。
代码片段和文件信息
package com.lebo.action;
import java.sql.*;
import java.util.*;
import com.lebo.bean.*;
import com.lebo.dao.*;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ActionContext;
public class LoginAction extends ActionSupport{
private Login login;
private String msg = ““;
public Login getLogin() {
return login;
}
public void setLogin(Login login) {
this.login = login;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String execute() throws Exception {
String name = login.getName();
System.out.println(name);
String sql = “select * from register where name = ‘“+login.getName()+“‘ and pwd = ‘“+login.getPwd()+“‘“;
ResultSet rs = DBConnect.getRS(sql);
if (!rs.next()){
msg = “用户名或密码错误,请重新输入!“;
DBConnect.close();
return INPUT;
} else {
ActionContext actionContext = ActionContext.getContext();
Mapject> session = actionContext.getSession();
session.put(“login“ login.getName());
//ActionContext.getContext().getSession().put(“login“ login.getloginName());
DBConnect.close();
return SUCCESS;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 835 2014-07-08 21:18 Struts2Test\.classpath
文件 1044 2014-07-08 17:31 Struts2Test\.project
文件 503 2014-07-08 17:31 Struts2Test\.settings\.jsdtscope
文件 364 2014-07-08 17:31 Struts2Test\.settings\org.eclipse.jdt.core.prefs
文件 485 2014-07-08 17:31 Struts2Test\.settings\org.eclipse.wst.common.component
文件 345 2014-07-08 17:31 Struts2Test\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2014-07-08 17:31 Struts2Test\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2014-07-08 17:31 Struts2Test\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 2301 2014-07-08 21:39 Struts2Test\build\classes\com\lebo\action\LoginAction.class
文件 1335 2014-07-08 21:39 Struts2Test\build\classes\com\lebo\action\RandomAction.class
文件 3504 2014-07-08 21:39 Struts2Test\build\classes\com\lebo\action\RandomNumUtil.class
文件 3060 2014-07-08 22:14 Struts2Test\build\classes\com\lebo\action\RegisterAction.class
文件 701 2014-07-08 21:39 Struts2Test\build\classes\com\lebo\bean\Login.class
文件 1249 2014-07-08 21:39 Struts2Test\build\classes\com\lebo\bean\Register.class
文件 2235 2014-07-08 21:39 Struts2Test\build\classes\com\lebo\dao\DBConnect.class
文件 908 2014-07-08 20:09 Struts2Test\build\classes\struts.xm
文件 1226 2014-07-08 17:22 Struts2Test\src\com\lebo\action\LoginAction.java
文件 865 2014-07-08 20:07 Struts2Test\src\com\lebo\action\RandomAction.java
文件 2917 2014-07-08 20:07 Struts2Test\src\com\lebo\action\RandomNumUtil.java
文件 1761 2014-07-09 11:21 Struts2Test\src\com\lebo\action\RegisterAction.java
文件 347 2014-07-08 17:18 Struts2Test\src\com\lebo\bean\Login.java
文件 771 2014-07-08 16:13 Struts2Test\src\com\lebo\bean\Register.java
文件 2541 2014-07-09 15:03 Struts2Test\src\com\lebo\dao\DBConnect.java
文件 908 2014-07-08 20:09 Struts2Test\src\struts.xm
文件 616 2014-07-08 19:54 Struts2Test\WebContent\index.jsp
文件 1275 2014-07-09 10:38 Struts2Test\WebContent\login.jsp
文件 917 2014-07-08 18:59 Struts2Test\WebContent\log_suc.jsp
文件 1533 2014-07-09 13:06 Struts2Test\WebContent\me
文件 39 2014-07-08 17:31 Struts2Test\WebContent\me
文件 2486 2014-07-09 11:21 Struts2Test\WebContent\register.jsp
............此处省略38个文件信息
相关资源
- shiro登录验证
- 服务器实现项目
- E语言冒险岛079联网登录器源码
- MyEclipse2017CI7破解工具破解文件带教程
- 去除BOM头小工具包含 msvcp71.dll 和 ms
- 标准struts2和mvc写的用户管理
- 微信小程序 [获取登录用户信息] 源码
- 使用struts2技术,实现登录功能不连接
- 使用Struts2框架完成一个简单的留言板
- easyui+ajax+json+servlet实现用户登录注册
- NS3_Eclipse联合使用初级教程
- 数据库与excel导入导出(JDBCmyeclipse)
- Struts2增删改查(完整项目版+源码+数
- apache-maven-3.5.3-bin。maven-3.5.3全面支持
- eclipse activiti的插件
- CS仿CF得易语言登陆器
- myeclipse-2019.4 & codemix crack.rar
- 使用Eclipse编译运行MapReduce程序.doc
- MyEclipse-2017-Stable2.0版本破解补丁.zip
- MyEclipse 2017 CI 10 和 MyEclipse 2017 Stable
- MyEclipse8.6的教程_安装、注册码、汉化
- Eclipse导出类图时序图亲测,安装截图
- Bytecode Outline-Eclipse插件.rar
- eclipse使用axis1.4发布联通vac的webservi
- QT 登录界面 仿QQ
- eclipse汉化包-直接替换文件-操作简单
- 登录验证源码
- CKEditor实现图片上传(使用Struts2)
- mac系统上myeclipse的svn插件
- SSM+Maven+ExtJs 在eclipse中实现的增删改查
评论
共有 条评论