/** * <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 */ protected String getParameter(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return mapping.getParameter(); }
public String getParameter() { if (this.overwritePrameters.containsKey(PARAMETER_KEY)) { return (String) this.overwritePrameters.get(PARAMETER_KEY); } return mapping.getParameter(); }
/** * 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); }
/** * <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; }
/** * 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("dispatch.parameter", mapping.getPath(), mapping.getParameter()); log.error(message); throw new ServletException(message); }
public class RedirectAction extends ForwardAction { @Override 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, true); retVal.setContextRelative(true); return retVal; } }
HttpServletRequest request, HttpServletResponse response) throws Exception { String parameter = mapping.getParameter();
throws Exception { String path = mapping.getParameter();
throws Exception { String path = mapping.getParameter();
@Override protected ActionForward filterDispatchMethod(final PhdProgramCandidacyProcessBean bean, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final PhdProgramPublicCandidacyHashCode hashCode = (bean != null ? bean.getCandidacyHashCode() : null); final String methodName = getMethodName(mapping, actionForm, request, response, mapping.getParameter()); if (methodName == null || !DO_NOT_VALIDATE_CANDIDACY_PERIOD_IN_METHODS.contains(methodName)) { if (isOutOfCandidacyPeriod(hashCode)) { request.setAttribute("candidacyPeriod", getPhdCandidacyPeriod(hashCode)); return mapping.findForward("out.of.candidacy.period"); } } return null; }
@Override protected ActionForward filterDispatchMethod(final PhdProgramCandidacyProcessBean bean, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final PhdProgramPublicCandidacyHashCode hashCode = (bean != null ? bean.getCandidacyHashCode() : null); final String methodName = getMethodName(mapping, actionForm, request, response, mapping.getParameter()); if (methodName == null || !DO_NOT_VALIDATE_CANDIDACY_PERIOD_IN_METHODS.contains(methodName)) { if (isOutOfCandidacyPeriod(hashCode)) { InstitutionPhdCandidacyPeriod nextCandidacyPeriod = InstitutionPhdCandidacyPeriod.readNextCandidacyPeriod(); request.setAttribute("candidacyPeriod", getPhdCandidacyPeriod(hashCode)); request.setAttribute("nextCandidacyPeriod", nextCandidacyPeriod); return mapping.findForward("outOfCandidacyPeriod"); } } return null; }
String message = messages.getMessage("dispatch.parameter", mapping.getPath(), mapping.getParameter());
messages.getMessage("event.parameter", mapping.getPath()); LOG.error(message + " " + mapping.getParameter());
public String execute(PojoInvocation invocation) { HttpServletRequest request = invocation.getRequest(); ActionMapping mapping = invocation.getActionMapping(); Class actionInterface = invocation.getActionInterface(); Object action = invocation.getActionInstance(); String param = mapping.getParameter(); if (param == null) { return invocation.execute(); } Method[] methods = actionInterface.getMethods(); if (methods.length < 2) { return invocation.execute(); } for (Enumeration paramNames = request.getParameterNames(); paramNames.hasMoreElements();) { String key = (String) paramNames.nextElement(); String methodName = request.getParameter(key); if (IndexedUtil.isIndexedParameter(key)) { String indexedParam = IndexedUtil.getParameter(key); if (param.equals(indexedParam)) { int index = IndexedUtil.getIndex(key); Method method = getMethod(methods, methodName); if (method != null) { return (String) MethodUtil.invoke(method, action, new Object[] { new Integer(index) }); } } } } return invocation.execute(); }
String parameter = mapping.getParameter(); if (parameter == null) { parameter = "def";
public String execute(PojoInvocation invocation) { HttpServletRequest request = invocation.getRequest(); ActionMapping mapping = invocation.getActionMapping(); Class actionInterface = invocation.getActionInterface(); Object action = invocation.getActionInstance(); String param = mapping.getParameter(); if (param == null) { return invocation.execute(); } Method[] methods = actionInterface.getMethods(); if (methods.length < 2) { return invocation.execute(); } String methodName = request.getParameter(param); Method method = getMethod(methods, methodName); if (method == null) { return invocation.execute(); } return (String) MethodUtil.invoke(method, action, null); }