01: /**
02: * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17: * USA
18: *
19: * Component of: Red Hat Application Server
20: *
21: * Initial Developers: Aizaz Ahmed
22: * Vivek Lakshmanan
23: * Andrew Overholt
24: * Matthew Wringe
25: *
26: */package olstore.action;
27:
28: import javax.servlet.http.HttpSession;
29:
30: import olstore.form.DemoDynaBaseForm;
31:
32: import org.apache.struts.action.ActionForm;
33: import org.apache.struts.action.ActionForward;
34: import org.apache.struts.action.ActionMapping;
35:
36: public class LoginAction extends DemoBaseAction {
37:
38: public ActionForward execute(ActionMapping mapping,
39: ActionForm form,
40: javax.servlet.http.HttpServletRequest request,
41: javax.servlet.http.HttpServletResponse response)
42: throws java.lang.Exception {
43: HttpSession session = request.getSession(false);
44: String username = null;
45: String password = null;
46: session = request.getSession(true);
47: //session.setAttribute("setMySession", new Boolean(true));
48: DemoDynaBaseForm loginForm = (DemoDynaBaseForm) form;
49: username = (String) loginForm.get("username");
50: password = (String) loginForm.get("password");
51: String path = "/j_security_check?j_username=" + username
52: + "&j_password=" + password;
53:
54: return new ActionForward(path, true);
55: }
56: }
|