1 27 package olstore.action; 28 29 import javax.servlet.http.HttpSession; 30 31 import olstore.form.DemoDynaBaseForm; 32 33 import org.apache.struts.action.ActionForm; 34 import org.apache.struts.action.ActionForward; 35 import org.apache.struts.action.ActionMapping; 36 37 38 public class LoginAction extends DemoBaseAction{ 39 40 public ActionForward execute(ActionMapping mapping, 41 ActionForm form, 42 javax.servlet.http.HttpServletRequest request, 43 javax.servlet.http.HttpServletResponse response) 44 throws java.lang.Exception{ 45 HttpSession session = request.getSession(false); 46 String username = null; 47 String password = null; 48 session = request.getSession(true); 49 DemoDynaBaseForm loginForm = (DemoDynaBaseForm) form; 51 username = (String) loginForm.get( "username"); 52 password = (String) loginForm.get("password"); 53 String path = "/j_security_check?j_username=" + 54 username + "&j_password=" + password; 55 56 return new ActionForward(path,true); 57 } 58 } 59 60 | Popular Tags |