registeraccountaction.java

来自「滑动窗口仿真程序」· Java 代码 · 共 45 行

JAVA
45
字号
/**
 * 
 */
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 + =
减小字号Ctrl + -
显示快捷键?