當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionForward.getPath方法代碼示例

本文整理匯總了Java中org.apache.struts.action.ActionForward.getPath方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionForward.getPath方法的具體用法?Java ActionForward.getPath怎麽用?Java ActionForward.getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.struts.action.ActionForward的用法示例。


在下文中一共展示了ActionForward.getPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleBeanUtilsPopulateError

import org.apache.struts.action.ActionForward; //導入方法依賴的package包/類
/**
 *  Handle bean population errors that are not crucial to flow of control. For example, if we have a
 *  beanUtils.populate exception when the user is trying to navigate somewhere outside of the editor, then
 *  let the navication happen without throwing an exception. Otherwise test for timeout and present message,
 *  else, assume its a "back button" problem and show message.
 *
 * @param  request               NOT YET DOCUMENTED
 * @param  response              NOT YET DOCUMENTED
 * @exception  ServletException  NOT YET DOCUMENTED
 * @exception  IOException       NOT YET DOCUMENTED
 */
private void handleBeanUtilsPopulateError(HttpServletRequest request, HttpServletResponse response)
	 throws ServletException, IOException {
	prtln("handling BeanUtils Populate Error");

	SessionRegistry sessionRegistry =
		(SessionRegistry) servlet.getServletContext().getAttribute("sessionRegistry");
	SessionBean sessionBean = (sessionRegistry != null) ? sessionRegistry.getSessionBean(request) : null;

	String requestUrl = getRequestUrl(request);
	String contextPath = request.getContextPath();

	// default destination
	String destination = response.encodeURL(contextPath + "/populate_error.jsp");

	// has the session timed out?
	if (sessionBean != null && sessionBean.getNumSecsToTimeout() < 1) {
		destination = response.encodeURL(contextPath + "/session_timed_out.jsp");
	}
	else {
		// prtln("NOT TIMED OUT!");
		/*
			prtln("request parameters");
		for (Enumeration i = request.getParameterNames(); i.hasMoreElements(); ) {
			prtln("\t" + (String) i.nextElement());
		}
		*/
		String command = request.getParameter("command");

		if (command != null && command.equals("exit")) {
			String pathArg = request.getParameter("pathArg");
			prtln("processing a \"guardedExit\" command");
			prtln("\t command: " + command);
			prtln("\t pathArg: " + pathArg);
			prtln ("\t contextPath: " + contextPath);
			if (pathArg != null && pathArg.equals("forwardToCaller")) {
				ActionForward forward = SchemEditUtils.forwardToCaller(request, request.getParameter("recId"), sessionBean);
				destination = contextPath + forward.getPath();
			}
			else {
				if (pathArg.startsWith("http://"))
					destination = response.encodeURL(pathArg);
				else
					destination = response.encodeURL(contextPath + pathArg);
			}
		}
	}
	prtln("destination: " + destination);
	response.sendRedirect(destination);
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:61,代碼來源:RequestProcessor.java

示例2: strutsForwardToURL

import org.apache.struts.action.ActionForward; //導入方法依賴的package包/類
/**
    * Takes a Struts forward containing the path such as /DisplayRequest.do and turns it into a full URL including
    * servername
    */
   protected String strutsForwardToURL(ActionForward forward) {
return Configuration.get(ConfigurationKeys.SERVER_URL) + ActivityMapping.LEARNING + forward.getPath();
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:8,代碼來源:ActivityMapping.java


注:本文中的org.apache.struts.action.ActionForward.getPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。