文件名称:Struts2注解+JDBC+MySQL小项目应用
文件大小:3.83MB
文件格式:RAR
更新时间:2015-02-05 10:33:08
JDBC MySQL Struts2注解 action
@Namespace("")
@Results({ @Result(name = "loginSuccess", location = "/WEB-INF/success.jsp"),
@Result(name = "loginFailure", location = "/WEB-INF/failure.jsp"),
@Result(name = "checkSuccess", location = "/WEB-INF/success.jsp"),
@Result(name = "checkFailure", location = "/WEB-INF/failure.jsp") })
public class LoginAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private String userName;
private String passWord;
private String resultMsg;
private int resultInt;
RegisterImpl regImpl = new RegisterImpl();
// 提交注册
@Action("register")
public String register() {
// 验证用户名是否重复
resultInt = regImpl.findByUserName(userName);
if (resultInt != 0) {
resultMsg = "用户名已被使用,请重新输入";
return "registerFailure";
} else {
resultInt = regImpl.register(userName, passWord);
if (1 == resultInt) {
// 1. 将用户信息保存到Session中。
Map
【文件预览】:
testStruts2
----.project(1KB)
----WebContent()
--------WEB-INF()
--------META-INF()
--------login.jsp(1KB)
----src()
--------com()
----.settings()
--------org.eclipse.wst.jsdt.ui.superType.container(49B)
--------org.eclipse.wst.common.project.facet.core.xml(345B)
--------org.eclipse.jdt.core.prefs(395B)
--------org.eclipse.wst.jsdt.ui.superType.name(6B)
--------org.eclipse.wst.common.component(463B)
--------.jsdtscope(503B)
----build()
--------classes()
----.classpath(835B)