本文整理汇总了Java中org.apache.struts.action.ActionRedirect.setPath方法的典型用法代码示例。如果您正苦于以下问题:Java ActionRedirect.setPath方法的具体用法?Java ActionRedirect.setPath怎么用?Java ActionRedirect.setPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.struts.action.ActionRedirect
的用法示例。
在下文中一共展示了ActionRedirect.setPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processMaintDocument
import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward processMaintDocument(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
ProcessMaintForm aDocForm = (ProcessMaintForm) form;
String category = aDocForm.getCategory();
String reason = aDocForm.getReason();
String positionId = aDocForm.getPositionId();
String path = ConfigContext.getCurrentContextConfig().getProperty("application.url");
String string1 = path + "/portal.do?channelTitle=Position&channelUrl=" + path + "/kpme/positionMaintenance?";
String idString = "hrPositionId=" + positionId + "&category=" + category + "&reason=" + reason;
String string2 = "&viewTypeName=MAINTENANCE&returnLocation=" + path + "/portal.do&methodToCall=maintenanceEdit&dataObjectClassName=org.kuali.kpme.pm.position.Position";
ActionRedirect redirect = new ActionRedirect();
redirect.setPath(string1 + idString + string2);
return redirect;
}
示例2: cancel
import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward cancel(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
LeavePayoutForm lpf = (LeavePayoutForm) form;
LeavePayout leavePayout = lpf.getLeavePayout();
String accrualCategoryRuleId = leavePayout.getAccrualCategoryRule();
AccrualCategoryRule accrualRule = HrServiceLocator.getAccrualCategoryRuleService().getAccrualCategoryRule(accrualCategoryRuleId);
String actionFrequency = accrualRule.getMaxBalanceActionFrequency();
if(StringUtils.equals(actionFrequency,HrConstants.MAX_BAL_ACTION_FREQ.ON_DEMAND))
return mapping.findForward("closeLeavePayoutDoc");
else
if(StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.LEAVE_APPROVE) ||
StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.YEAR_END)) {
String documentId = leavePayout.getLeaveCalendarDocumentId();
TimesheetDocumentHeader tsdh = TkServiceLocator.getTimesheetDocumentHeaderService().getDocumentHeader(documentId);
LeaveCalendarDocumentHeader lcdh = LmServiceLocator.getLeaveCalendarDocumentHeaderService().getDocumentHeader(documentId);
String strutsActionForward = "";
if(ObjectUtils.isNull(tsdh) && ObjectUtils.isNull(lcdh)) {
strutsActionForward = "/";
}
else if(ObjectUtils.isNotNull(tsdh)) {
//Throws runtime exception, separate action forwards for timesheet/leave calendar transfers.
strutsActionForward = mapping.findForward("timesheetCancel").getPath() + "?documentId=" + leavePayout.getLeaveCalendarDocumentId();
}
else {
strutsActionForward = mapping.findForward("leaveCalendarCancel").getPath() + "?documentId=" + leavePayout.getLeaveCalendarDocumentId();
}
ActionRedirect redirect = new ActionRedirect();
redirect.setPath(strutsActionForward);
return redirect;
}
else {
LOG.warn("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, "action.reachable.through.triggers");
// throw new RuntimeException("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
return mapping.findForward("basic");
}
}
示例3: approveLeaveCalendar
import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward approveLeaveCalendar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
String documentId = request.getParameter("documentId");
String action = request.getParameter("action");
LeaveCalendarDocument document = LmServiceLocator.getLeaveCalendarService().getLeaveCalendarDocument(documentId);
// Switched to grab the target (chain, resolution: target -> backdoor -> actual) user.
// Approvals still using backdoor > actual
if (StringUtils.equals(action, HrConstants.DOCUMENT_ACTIONS.ROUTE)) {
if (DocumentStatus.INITIATED.getCode().equals(document.getDocumentHeader().getDocumentStatus())
|| DocumentStatus.SAVED.getCode().equals(document.getDocumentHeader().getDocumentStatus())) {
Map<String,Set<LeaveBlock>> eligibilities = LmServiceLocator.getAccrualCategoryMaxBalanceService().getMaxBalanceViolations(document.getCalendarEntry(), document.getPrincipalId());
ActionRedirect transferRedirect = new ActionRedirect();
ActionRedirect payoutRedirect = new ActionRedirect();
List<LeaveBlock> eligibleTransfers = new ArrayList<LeaveBlock>();
List<LeaveBlock> eligiblePayouts = new ArrayList<LeaveBlock>();
Interval interval = new Interval(document.getCalendarEntry().getBeginPeriodFullDateTime(), document.getCalendarEntry().getEndPeriodFullDateTime());
for(Entry<String,Set<LeaveBlock>> entry : eligibilities.entrySet()) {
for(LeaveBlock lb : entry.getValue()) {
if(interval.contains(lb.getLeaveDateTime())) {
//maxBalanceViolations should, if a violation exists, return a leave block with leave date either current date, or the end period date - 1 days.
PrincipalHRAttributes pha = HrServiceLocator.getPrincipalHRAttributeService().getPrincipalCalendar(document.getPrincipalId(), lb.getLeaveLocalDate());
AccrualCategoryRuleContract aRule = lb.getAccrualCategoryRule();
if(ObjectUtils.isNotNull(aRule)
&& !StringUtils.equals(aRule.getMaxBalanceActionFrequency(),HrConstants.MAX_BAL_ACTION_FREQ.ON_DEMAND)) {
if(StringUtils.equals(aRule.getMaxBalanceActionFrequency(),HrConstants.MAX_BAL_ACTION_FREQ.LEAVE_APPROVE)
|| (StringUtils.equals(aRule.getMaxBalanceActionFrequency(),HrConstants.MAX_BAL_ACTION_FREQ.YEAR_END)
&& HrServiceLocator.getLeavePlanService().isLastCalendarPeriodOfLeavePlan(document.getCalendarEntry(),pha.getLeavePlan(),lb.getLeaveLocalDate())))
if(StringUtils.equals(aRule.getActionAtMaxBalance(),HrConstants.ACTION_AT_MAX_BALANCE.PAYOUT)) {
eligiblePayouts.add(lb);
}
else if(StringUtils.equals(aRule.getActionAtMaxBalance(), HrConstants.ACTION_AT_MAX_BALANCE.TRANSFER)
|| StringUtils.equals(aRule.getActionAtMaxBalance(), HrConstants.ACTION_AT_MAX_BALANCE.LOSE)) {
eligibleTransfers.add(lb);
}
}
}
}
}
if(CollectionUtils.isNotEmpty(eligibleTransfers)) {
//LOSE actions get lumped into this set, and are redirected back to this page to handle submission via dialog.
transferRedirect.setPath("/BalanceTransfer.do?"+request.getQueryString());
request.getSession().setAttribute("eligibilities", eligibleTransfers);
return transferRedirect;
}
if(CollectionUtils.isNotEmpty(eligiblePayouts)) {
payoutRedirect.setPath("/LeavePayout.do?"+request.getQueryString());
request.getSession().setAttribute("eligibilities", eligiblePayouts);
return payoutRedirect;
}
LmServiceLocator.getLeaveCalendarService().routeLeaveCalendar(HrContext.getTargetPrincipalId(), document);
}
} else if (StringUtils.equals(action, HrConstants.DOCUMENT_ACTIONS.APPROVE)) {
if (LmServiceLocator.getLeaveCalendarService().isReadyToApprove(document)) {
if (document.getDocumentHeader().getDocumentStatus().equals(DocumentStatus.ENROUTE.getCode())) {
LmServiceLocator.getLeaveCalendarService().approveLeaveCalendar(HrContext.getPrincipalId(), document);
}
} else {
//ERROR!!!!
}
} else if (StringUtils.equals(action, HrConstants.DOCUMENT_ACTIONS.DISAPPROVE)) {
if (document.getDocumentHeader().getDocumentStatus().equals(DocumentStatus.ENROUTE.getCode())) {
LmServiceLocator.getLeaveCalendarService().disapproveLeaveCalendar(HrContext.getPrincipalId(), document);
}
}
ActionRedirect rd = new ActionRedirect(mapping.findForward("leaveCalendarRedirect"));
TkServiceLocator.getTkSearchableAttributeService().updateSearchableAttribute(document, document.getAsOfDate());
rd.addParameter("documentId", documentId);
return rd;
}
示例4: cancel
import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward cancel(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
BalanceTransferForm btf = (BalanceTransferForm) form;
BalanceTransfer bt = btf.getBalanceTransfer();
if(btf.isSstoTransfer()) {
return mapping.findForward("closeBalanceTransferDoc");
}
String accrualCategoryRuleId = bt.getAccrualCategoryRule();
AccrualCategoryRule accrualRule = HrServiceLocator.getAccrualCategoryRuleService().getAccrualCategoryRule(accrualCategoryRuleId);
String actionFrequency = accrualRule.getMaxBalanceActionFrequency();
if(StringUtils.equals(actionFrequency,HrConstants.MAX_BAL_ACTION_FREQ.ON_DEMAND))
return mapping.findForward("closeBalanceTransferDoc");
else
if(StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.LEAVE_APPROVE) ||
StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.YEAR_END)) {
String documentId = bt.getLeaveCalendarDocumentId();
//HrServiceLocator.getCalendarDocumentHeaderService().getCalendarDocumentHeader(documentId)
TimesheetDocumentHeader tsdh = TkServiceLocator.getTimesheetDocumentHeaderService().getDocumentHeader(documentId);
LeaveCalendarDocumentHeader lcdh = LmServiceLocator.getLeaveCalendarDocumentHeaderService().getDocumentHeader(documentId);
String strutsActionForward = "";
if(ObjectUtils.isNull(tsdh) && ObjectUtils.isNull(lcdh)) {
strutsActionForward = "/";
}
else if(ObjectUtils.isNotNull(tsdh)) {
//Throws runtime exception, separate action forwards for timesheet/leave calendar transfers.
strutsActionForward = mapping.findForward("timesheetCancel").getPath() + "?documentId=" + bt.getLeaveCalendarDocumentId();
}
else {
strutsActionForward = mapping.findForward("leaveCalendarCancel").getPath() + "?documentId=" + bt.getLeaveCalendarDocumentId();
}
ActionRedirect redirect = new ActionRedirect();
redirect.setPath(strutsActionForward);
return redirect;
}
else {
LOG.error("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, "action.reachable.through.triggers");
return mapping.findForward("basic");
// throw new RuntimeException("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
}
}
示例5: userLogout
import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward userLogout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
request.getSession().invalidate();
ActionRedirect redirect = new ActionRedirect();
redirect.setPath("portal.do");
return redirect;
}