1 18 19 package org.apache.struts.webapp.tiles.channel; 20 21 import javax.servlet.http.HttpServletRequest ; 22 import javax.servlet.http.HttpServletResponse ; 23 import javax.servlet.http.HttpSession ; 24 import org.apache.struts.action.Action; 25 import org.apache.struts.action.ActionForm; 26 import org.apache.struts.action.ActionForward; 27 import org.apache.struts.action.ActionMapping; 28 29 public final class SelectChannelAction extends Action { 30 31 32 34 35 50 public ActionForward execute( 51 ActionMapping mapping, 52 ActionForm form, 53 HttpServletRequest request, 54 HttpServletResponse response) 55 throws Exception { 56 57 String requested = (String )request.getParameter( "channel" ); 59 60 if( requested == null ) 61 return (mapping.findForward("failed")); 62 63 HttpSession session = request.getSession(false); 65 if (session != null) 66 session.setAttribute(ChannelFactorySet.FACTORY_SELECTOR_KEY, requested); 67 System.out.println( "Set channel to '" + requested + "'" ); 68 return (mapping.findForward("success")); 69 } 70 71 } 72 | Popular Tags |