📄 registeraction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.internetshop.struts.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessages;
import com.internetshop.struts.form.RegisterForm;
/**
* MyEclipse Struts
* Creation date: 04-22-2008
*
* XDoclet definition:
* @struts.action path="/registry" name="registryForm" input="/form/registry.jsp" scope="request" validate="true"
*/
public class RegisterAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RegisterForm registerForm = (RegisterForm) form;// TODO Auto-generated method stub
ActionErrors errors = new ActionErrors();
String password=registerForm.getPassword();
String passwordAnswer=registerForm.getPasswordAnswer();
String userName=registerForm.getUserName();
String confirmPassword=registerForm.getConfirmPassword();
String email=registerForm.getEmail();
String trueName=registerForm.getTrueName();
String passwordQuestion=registerForm.getPasswordQuestion();
try
{
RegisterOp register = new RegisterOp(userName,password,email,passwordQuestion,passwordAnswer,trueName);
register.InsertMemberMessage();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println(e.getMessage());
errors.add(new ActionMessages());
saveErrors(request,errors);
return new ActionForward(mapping.getInput());
}
return mapping.findForward("registerSuccess");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -