1 21 22 package org.opensubsystems.core.www; 23 24 import java.io.IOException ; 25 26 import javax.servlet.ServletConfig ; 27 import javax.servlet.ServletException ; 28 import javax.servlet.http.HttpServletRequest ; 29 import javax.servlet.http.HttpServletResponse ; 30 31 import org.opensubsystems.core.error.OSSException; 32 33 46 public class WebUIDispatchServlet extends WebUIServlet 47 { 48 50 53 public static final String DISPATCH_PAGE = "dispatch.page"; 54 55 57 60 public static final String ACTIVE_MODULE_NAME = "activemodule"; 61 62 64 67 private static final long serialVersionUID = 322547463691937622L; 68 69 71 74 public void init( 75 ServletConfig scConfig 76 ) throws ServletException 77 { 78 super.init(scConfig); 79 80 cacheUIPath(scConfig, DISPATCH_PAGE, 82 "Path to page to display is not set in property " + DISPATCH_PAGE); 83 } 84 85 88 public String getServletInfo( 89 ) 90 { 91 return this.getClass().getName(); 92 } 93 94 97 protected void doGet( 98 HttpServletRequest hsrqRequest, 99 HttpServletResponse hsrpResponse 100 ) throws ServletException , 101 IOException 102 { 103 String strModuleName = null; 104 try 107 { 108 strModuleName = WebModuleDefinitionManager.getInstance( 109 ).getModuleNameFromURL(hsrqRequest.getServletPath()); 110 } 111 catch (OSSException osseExc) 112 { 113 throw new ServletException ("An unexpected exception has occured " + 114 "while getting web module name from URL.", osseExc); 115 } 116 117 if ((strModuleName != null) && (strModuleName.length() > 0)) 118 { 119 hsrqRequest.setAttribute(ACTIVE_MODULE_NAME, strModuleName); 121 } 122 123 displayUI(DISPATCH_PAGE, hsrqRequest, hsrpResponse); 125 } 126 } 127 | Popular Tags |