当前位置: 首页>>代码示例>>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;未经允许,请勿转载。