1 package hero.struts.actions; 2 3 import java.io.IOException ; 4 import javax.servlet.ServletException ; 5 import javax.servlet.http.HttpServletRequest ; 6 import javax.servlet.http.HttpServletResponse ; 7 import org.apache.struts.action.ActionErrors; 8 import org.apache.struts.action.ActionForm; 9 import org.apache.struts.action.ActionMapping; 10 import org.apache.struts.action.ActionForward; 11 12 import java.util.*; 13 14 import hero.interfaces.*; 15 16 22 public class InitialAction extends AbstStrutsActionBase 23 { 24 25 public boolean authenticate(String username, String password) 26 { 27 return(true); 28 } 29 30 38 public ActionForward perform(ActionMapping mapping, ActionForm form, 39 HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException 40 { 41 42 ActionForward actionForward = mapping.findForward(INITIAL); 43 ActionErrors errors = new ActionErrors(); 45 46 try 47 { 48 hero.interfaces.AllProjectsSessionLocalHome projecth = (AllProjectsSessionLocalHome)hero.interfaces.AllProjectsSessionUtil.getLocalHome(); 49 50 hero.interfaces.AllProjectsSessionLocal projectl = projecth.create(); 51 52 Vector projects = new Vector((Collection)projectl.getProjects()); 53 request.getSession(true).setAttribute("allprojects",projects); 54 request.getSession(true).setAttribute("wsname",null); 55 56 }catch(Exception e){e.printStackTrace();throw new ServletException ();}; 57 58 if (!errors.empty()) { 59 saveErrors(request, errors); 60 } 61 62 return (actionForward); 64 } 65 66 } 67
| Popular Tags
|