/** * Method which is dispatched to when there is no value for specified * request parameter included in the request. Subclasses of * <code>DispatchAction</code> should override this method if they wish to * provide default behavior different than throwing a ServletException. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The non-HTTP request we are processing * @param response The non-HTTP response we are creating * @return The forward to which control should be transferred, or * <code>null</code> if the response has been completed. * @throws Exception if the application business logic throws an * exception. */ protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String message = messages.getMessage("event.parameter", mapping.getPath(), mapping.getParameter()); LOG.error(message + " " + mapping.getParameter()); throw new ServletException(message); }
/** * Method which is dispatched to when there is no value for specified * request parameter included in the request. Subclasses of * <code>DispatchAction</code> should override this method if they wish * to provide default behavior different than throwing a ServletException. */ protected ActionForward unspecified( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String message = messages.getMessage( "dispatch.parameter", mapping.getPath(), mapping.getParameter()); log.error(message); throw new ServletException(message); }
/** * <p>Returns the parameter value.</p> * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * @return The <code>ActionMapping</code> parameter's value * @throws Exception if the parameter is missing. */ protected String getParameter(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Identify the request parameter containing the method name String parameter = mapping.getParameter(); if (parameter == null) { String message = messages.getMessage("dispatch.handler", mapping.getPath()); log.error(message); throw new ServletException(message); } return parameter; }
throws Exception { String parameter = mapping.getParameter(); if ("".equals(parameter)) { parameter = null;
String path = mapping.getParameter(); if (path == null) { throw new ServletException(messages.getMessage("include.path"));
/** * <p>Dispatches to the target class' <code>unspecified</code> method, * if present, otherwise throws a ServletException. Classes utilizing * <code>ActionDispatcher</code> should provide an <code>unspecified</code> * method if they wish to provide behavior different than * throwing a ServletException..</p> */ protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Identify if there is an "unspecified" method to be dispatched to String name = "unspecified"; Method method = null; try { method = getMethod(name); } catch (NoSuchMethodException e) { String message = messages.getMessage("dispatch.parameter", mapping.getPath(), mapping.getParameter()); log.error(message); throw new ServletException(message); } return dispatchMethod(mapping, form, request, response, name, method); }
/** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). * Return an <code>ActionForward</code> instance describing where and how * control should be forwarded, or <code>null</code> if the response has * already been completed. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * * @exception Exception if an error occurs */ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Create a RequestDispatcher the corresponding resource String path = mapping.getParameter(); if (path == null) { throw new ServletException(messages.getMessage("forward.path")); } // Let the controller handle the request ActionForward retVal = new ActionForward(path); retVal.setContextRelative(true); return retVal; }
messages.getMessage("event.parameter", mapping.getPath()); LOG.error(message + " " + mapping.getParameter());
String parameter = mapping.getParameter(); if (parameter == null) { parameter = "def";
config.setType(convertParam(orig.getType(), vars)); config.setRoles(convertParam(orig.getRoles(), vars)); config.setParameter(convertParam(orig.getParameter(), vars)); config.setAttribute(convertParam(orig.getAttribute(), vars)); config.setForward(convertParam(orig.getForward(), vars));
if (getParameter() == null) { setParameter(config.getParameter());
config.setType(convertParam(orig.getType(), vars)); config.setRoles(convertParam(orig.getRoles(), vars)); config.setParameter(convertParam(orig.getParameter(), vars)); config.setAttribute(convertParam(orig.getAttribute(), vars)); config.setForward(convertParam(orig.getForward(), vars));