📄 registeraccountaction.java
字号:
/**
*
*/
package com.tarena.account.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.context.ApplicationContext;
import org.springframework.web.struts.ActionSupport;
import com.tarena.account.form.RegisterAccountForm;
import com.tarena.service.IAccountService;
/**
* @author dong xuyuan
*
*/
public class RegisterAccountAction extends ActionSupport {
@Override
public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response) throws Exception {
System.out.println("enter the register account action");
ApplicationContext ctx = this.getWebApplicationContext();
IAccountService accountServcie = (IAccountService)ctx.getBean("accountservice");
RegisterAccountForm form = (RegisterAccountForm)actionForm;
accountServcie.registerAccount(form.getUsername(), form.getPassword(), form.getDescription());
return mapping.findForward("success");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -