/** * <p>Get the original path without the parameters added at runtime.</p> * * @return the original path as configured. */ public String getOriginalPath() { return super.getPath(); }
protected ActionForward processForward(HttpServletRequest request, ActionForward forward) { return ExecutionCourseBaseAction.forward(request, forward.getPath()); }
/** * <p> Renders the reference for a HTML <base> element. </p> */ public String getBaseRef() { if (request == null) { return null; } StringBuffer result = RequestUtils.requestToServerStringBuffer(request); String path; if (forward == null) { path = request.getRequestURI(); } else { path = request.getContextPath() + forward.getPath(); } result.append(path); return result.toString(); }
/** * <p>Return a path to which an include should be attempted in the case * when the response was committed before the <code>ExceptionHandler</code> * was invoked. </p> <p>If the <code>ExceptionConfig</code> has the * property <code>INCLUDE_PATH</code> defined, then the value of that * property will be returned. Otherwise, the ActionForward path is * returned. </p> * * @param config Configuration element * @param actionForward Forward to use on error * @return Path of resource to include * @since Struts 1.3 */ protected String determineIncludePath(ExceptionConfig config, ActionForward actionForward) { String includePath = config.getProperty("INCLUDE_PATH"); if (includePath == null) { includePath = actionForward.getPath(); } return includePath; }
@Override public String getPath() { String current = super.getPath(); String mark = ""; if (current.indexOf("?") == -1) { mark = "?"; } String amp = ""; if (mark.length() == 0) { amp = "&"; } String module = getPathModule(); String context = request.getContextPath(); String checksum = GenericChecksumRewriter.calculateChecksum(context + module + current, request.getSession(false)); return String.format("%s%s%s%s=%s", current, mark, amp, GenericChecksumRewriter.CHECKSUM_ATTRIBUTE_NAME, checksum); }
/** * <p> Return the path for the specified forward, otherwise return * <code>null</code>. </p> * * @param name Name given to local or global forward. */ public String getLink(String name) { ActionForward forward = getActionForward(name); if (forward == null) { return null; } StringBuffer path = new StringBuffer(this.request.getContextPath()); path.append(forward.getPath()); // :TODO: What about runtime parameters? return getEncodeURL(path.toString()); }
@Override public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { ManageExecutionCourseDA.propageContextIds(request); String executionCourseId = (String) request.getAttribute("executionCourseID"); request.setAttribute("module", "/teacher"); request.setAttribute("contextPrefix", "/executionCourseForumManagement.do?executionCourseID=" + executionCourseId); request.setAttribute("executionCourseId", executionCourseId); ActionForward forward = super.execute(mapping, actionForm, request, response); return ManageExecutionCourseDA.forward(request, forward.getPath()); }
protected ActionForward forward(ActionMapping mapping, HttpServletRequest request, String name, String parameter) { ActionForward existing = mapping.findForward(name); ActionForward result = new FenixActionForward(request, existing); if (parameter != null) { String[] values = request.getParameterValues(parameter); if (values == null) { return result; } StringBuilder path = new StringBuilder(existing.getPath()); for (String value : values) { path.append(String.format("&%s=%s", parameter, value)); } result.setPath(path.toString()); } return result; }
@Override public ActionForward performLookup(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // parse out the business object name from our methodToCall parameter String fullParameter = (String) request.getAttribute(KFSConstants.METHOD_TO_CALL_ATTRIBUTE); String boClassName = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_BOPARM_LEFT_DEL, KFSConstants.METHOD_TO_CALL_BOPARM_RIGHT_DEL); if (!StringUtils.equals(boClassName, GeneralLedgerPendingEntry.class.getName())) { return super.performLookup(mapping, form, request, response); } String path = super.performLookup(mapping, form, request, response).getPath(); path = path.replaceFirst(KFSConstants.LOOKUP_ACTION, KFSConstants.GL_MODIFIED_INQUIRY_ACTION); return new ActionForward(path, true); }
ActionForward originalForward = a_mapping.findForward ("Success"); String path = originalForward.getPath() + "?multitablesId=WeeklyDeliveryInstances-Count&name=WeeklyDeliveryInstances-Count&type=excel"; ActionForward forward = new ActionForward(path); forward.setRedirect(true); return (forward);
/** * @see org.kuali.rice.kns.web.struts.action.KualiAction#performLookup(org.apache.struts.action.ActionMapping, * org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public ActionForward performLookup(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // parse out the business object name from our methodToCall parameter String fullParameter = (String) request.getAttribute(KFSConstants.METHOD_TO_CALL_ATTRIBUTE); String boClassName = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_BOPARM_LEFT_DEL, KFSConstants.METHOD_TO_CALL_BOPARM_RIGHT_DEL); if (StringUtils.equals(boClassName, LaborLedgerPendingEntry.class.getName())) { String path = super.performLookup(mapping, form, request, response).getPath(); path = path.replaceFirst(KFSConstants.LOOKUP_ACTION, LaborConstants.LONG_ROW_TABLE_INRUIRY_ACTION); return new ActionForward(path, true); } else if (StringUtils.equals(boClassName, PositionData.class.getName())) { String path = super.performLookup(mapping, form, request, response).getPath(); path = path.replaceFirst(KFSConstants.LOOKUP_ACTION, KFSConstants.GL_MODIFIED_INQUIRY_ACTION); return new ActionForward(path, true); } else { return super.performLookup(mapping, form, request, response); } }
/** * @param mapping ActionMapping * @param form ActionForm * @param request HttpServletRequest * @param response HttpServletResponse * @see org.kuali.rice.kns.web.struts.action.KualiAction#performLookup(org.apache.struts.action.ActionMapping, * org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public ActionForward performLookup(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // parse out the business object name from our methodToCall parameter String fullParameter = (String) request.getAttribute(KFSConstants.METHOD_TO_CALL_ATTRIBUTE); String boClassName = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_BOPARM_LEFT_DEL, KFSConstants.METHOD_TO_CALL_BOPARM_RIGHT_DEL); if (!StringUtils.equals(boClassName, LaborLedgerPendingEntry.class.getName())) { return super.performLookup(mapping, form, request, response); } String path = super.performLookup(mapping, form, request, response).getPath(); path = path.replaceFirst(KFSConstants.LOOKUP_ACTION, LaborConstants.LONG_ROW_TABLE_INRUIRY_ACTION); return new ActionForward(path, true); }
@Override public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { DegreeCoordinatorIndex.setCoordinatorContext(request); DegreeCurricularPlan degreeCurricularPlan = getDegreeCurricularPlan(request); if (degreeCurricularPlan != null) { request.setAttribute("degreeCurricularPlan", degreeCurricularPlan); } request.setAttribute("siteUrl", degreeCurricularPlan.getDegree().getSiteUrl()); request.setAttribute("siteActionName", "/degreeSiteManagement.do"); request.setAttribute("siteContextParam", "degreeCurricularPlanID"); request.setAttribute("siteContextParamValue", degreeCurricularPlan.getExternalId()); ActionForward forward = super.execute(mapping, actionForm, request, response); request.setAttribute("coordinator$actual$page", forward.getPath()); return new ActionForward("/degreeSite/siteFrame.jsp"); }
/** * <p>Construct a new instance based on the values of another * ActionForward.</p> * * @param copyMe An ActionForward instance to copy * @since Struts 1.2.1 */ public ActionForward(ActionForward copyMe) { this(copyMe.getName(), copyMe.getPath(), copyMe.getRedirect(), copyMe.getModule()); } }
public MockActionForward(ActionForward copyMe) { setName(copyMe.getName()); setPath(copyMe.getPath()); setRedirect(copyMe.getRedirect()); try { Method getContextRelativeMethod = copyMe.getClass().getMethod("getContextRelative", null); Boolean value = (Boolean)getContextRelativeMethod.invoke(copyMe, null); if(null != value) { setContextRelative(value.booleanValue()); } } catch(Exception exc) { //Struts 1.3 does not define the method "getContextRelative" //this hack is necessary to avoid different versions for Struts 1.2 and 1.3 } }
public MockActionForward(ActionForward copyMe) { setName(copyMe.getName()); setPath(copyMe.getPath()); setRedirect(copyMe.getRedirect()); try { Method getContextRelativeMethod = copyMe.getClass().getMethod("getContextRelative", null); Boolean value = (Boolean)getContextRelativeMethod.invoke(copyMe, null); if(null != value) { setContextRelative(value.booleanValue()); } } catch(Exception exc) { //Struts 1.3 does not define the method "getContextRelative" //this hack is necessary to avoid different versions for Struts 1.2 and 1.3 } }
public MockActionForward(ActionForward copyMe) { setName(copyMe.getName()); setPath(copyMe.getPath()); setRedirect(copyMe.getRedirect()); try { Method getContextRelativeMethod = copyMe.getClass().getMethod("getContextRelative", null); Boolean value = (Boolean)getContextRelativeMethod.invoke(copyMe, null); if(null != value) { setContextRelative(value); } } catch(Exception exc) { //Struts 1.3 does not define the method "getContextRelative" //this hack is necessary to avoid different versions for Struts 1.2 and 1.3 } }
public ActionForward editTimeBlock(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ClockActionForm caf = (ClockActionForm) form; TimeBlock tb = caf.getCurrentTimeBlock(); caf.setCurrentAssignmentKey(tb.getAssignmentKey()); caf.populateAssignmentsForSelectedTimeBlock(tb); ActionForward forward = mapping.findForward("et"); return new ActionForward(forward.getPath() + "?editTimeBlockId=" + tb.getTkTimeBlockId().toString()); } public ActionForward addTimeBlock(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
public ActionForward addTimeBlock(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ClockActionForm caf = (ClockActionForm) form; TimeBlock currentTb = caf.getCurrentTimeBlock(); List<TimeBlock> newTimeBlocks = caf.getTimesheetDocument().getTimeBlocks(); List<TimeBlock> referenceTimeBlocks = new ArrayList<TimeBlock>(caf.getTimesheetDocument().getTimeBlocks().size()); for (TimeBlock tb : caf.getTimesheetDocument().getTimeBlocks()) { referenceTimeBlocks.add(TimeBlock.Builder.create(tb).build()); } //call persist method that only saves added/deleted/changed timeblocks TkServiceLocator.getTimeBlockService().saveOrUpdateTimeBlocks(referenceTimeBlocks, newTimeBlocks, HrContext.getPrincipalId()); ActionForward forward = mapping.findForward("et"); return new ActionForward(forward.getPath() + "?editTimeBlockId=" + currentTb.getTkTimeBlockId().toString()); }
/** * Find an action forward for given application view. If no suitable forward is found in the action mapping using * the view name as a key, this method will create a new action forward using the view name. * @param forward the application view to find a forward for * @param mapping the action mapping to use * @return the action forward, never null */ protected ActionForward findForward(ApplicationView forward, ActionMapping mapping) { // note that this method is always creating a new ActionForward to make // sure that the redirect flag is false -- redirect is controlled by SWF // itself, not Struts ActionForward actionForward = mapping.findForward(forward.getViewName()); if (actionForward != null) { // the 1.2.1 copy constructor would ideally be better to // use, but it is not Struts 1.1 compatible actionForward = new ActionForward(actionForward.getName(), actionForward.getPath(), false); } else { actionForward = new ActionForward(forward.getViewName(), false); } return actionForward; } }