public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
// --------------------------------------------------------- Public Methods
// See superclass for JavaDoc
// Identify the request parameters controlling our actions
String page = request.getParameter("page");
String prefix = request.getParameter("prefix");
if ((page == null) || (prefix == null)) {
String message = messages.getMessage("switch.required");
log.error(message);
throw new ServletException(message);
}
// Switch to the requested module
ModuleUtils.getInstance().selectModule(prefix, request, getServlet().getServletContext());
if (request.getAttribute(Globals.MODULE_KEY) == null) {
String message = messages.getMessage("switch.prefix", prefix);
log.error(message);
throw new ServletException(message);
}
// Forward control to the specified module-relative URI
return (new ActionForward(page));
}
|