本文整理汇总了Java中org.apache.struts.util.RequestUtils.actionIdURL方法的典型用法代码示例。如果您正苦于以下问题:Java RequestUtils.actionIdURL方法的具体用法?Java RequestUtils.actionIdURL怎么用?Java RequestUtils.actionIdURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.struts.util.RequestUtils
的用法示例。
在下文中一共展示了RequestUtils.actionIdURL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processForward
import org.apache.struts.util.RequestUtils; //导入方法依赖的package包/类
/**
* <p>Process a forward requested by this mapping (if any). Return
* <code>true</code> if standard processing should continue, or
* <code>false</code> if we have already handled this request.</p>
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param mapping The ActionMapping we are using
* @return <code>true</code> to continue normal processing;
* <code>false</code> if a response has been created.
* @throws IOException if an input/output error occurs
* @throws ServletException if a servlet exception occurs
*/
protected boolean processForward(HttpServletRequest request,
HttpServletResponse response, ActionMapping mapping)
throws IOException, ServletException {
// Are we going to processing this request?
String forward = mapping.getForward();
if (forward == null) {
return (true);
}
// If the forward can be unaliased into an action, then use the path of the action
String actionIdPath = RequestUtils.actionIdURL(forward, this.moduleConfig, this.servlet);
if (actionIdPath != null) {
forward = actionIdPath;
}
internalModuleRelativeForward(forward, request, response);
return (false);
}
示例2: processInclude
import org.apache.struts.util.RequestUtils; //导入方法依赖的package包/类
/**
* <p>Process an include requested by this mapping (if any). Return
* <code>true</code> if standard processing should continue, or
* <code>false</code> if we have already handled this request.</p>
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param mapping The ActionMapping we are using
* @return <code>true</code> to continue normal processing;
* <code>false</code> if a response has been created.
* @throws IOException if an input/output error occurs
* @throws ServletException if thrown by invoked methods
*/
protected boolean processInclude(HttpServletRequest request,
HttpServletResponse response, ActionMapping mapping)
throws IOException, ServletException {
// Are we going to processing this request?
String include = mapping.getInclude();
if (include == null) {
return (true);
}
// If the forward can be unaliased into an action, then use the path of the action
String actionIdPath = RequestUtils.actionIdURL(include, this.moduleConfig, this.servlet);
if (actionIdPath != null) {
include = actionIdPath;
}
internalModuleRelativeInclude(include, request, response);
return (false);
}
示例3: perform
import org.apache.struts.util.RequestUtils; //导入方法依赖的package包/类
/**
* <p>Perform the appropriate processing on the specified
* <code>ForwardConfig</code>.</p>
*
* @param context The context for this request
* @param forwardConfig The forward to be performed
*/
protected void perform(ActionContext context, ForwardConfig forwardConfig)
throws Exception {
ServletActionContext sacontext = (ServletActionContext) context;
String uri = forwardConfig.getPath();
if (uri == null) {
ActionServlet servlet = sacontext.getActionServlet();
MessageResources resources = servlet.getInternal();
throw new IllegalArgumentException(resources.getMessage("forwardPathNull"));
}
HttpServletRequest request = sacontext.getRequest();
ServletContext servletContext = sacontext.getContext();
HttpServletResponse response = sacontext.getResponse();
// If the forward can be unaliased into an action, then use the path of the action
String actionIdPath = RequestUtils.actionIdURL(forwardConfig, sacontext.getRequest(), sacontext.getActionServlet());
if (actionIdPath != null) {
uri = actionIdPath;
ForwardConfig actionIdForwardConfig = new ForwardConfig(forwardConfig);
actionIdForwardConfig.setPath(actionIdPath);
forwardConfig = actionIdForwardConfig;
}
if (uri.startsWith("/")) {
uri = resolveModuleRelativePath(forwardConfig, servletContext, request);
}
if (response.isCommitted() && !forwardConfig.getRedirect()) {
handleAsInclude(uri, servletContext, request, response);
} else if (forwardConfig.getRedirect()) {
handleAsRedirect(uri, request, response);
} else {
handleAsForward(uri, servletContext, request, response);
}
}
示例4: includePath
import org.apache.struts.util.RequestUtils; //导入方法依赖的package包/类
protected String includePath(ActionContext actionContext, String include) {
ServletActionContext swcontext = (ServletActionContext) actionContext;
String actionIdPath = RequestUtils.actionIdURL(include, swcontext.getModuleConfig(), swcontext.getActionServlet());
if (actionIdPath != null) {
return super.includePath(actionContext, actionIdPath);
} else {
return super.includePath(actionContext, include);
}
}
示例5: processForwardConfig
import org.apache.struts.util.RequestUtils; //导入方法依赖的package包/类
/**
* <p>Forward or redirect to the specified destination, by the specified
* mechanism. This method uses a <code>ForwardConfig</code> object
* instead an <code>ActionForward</code>.</p>
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param forward The ForwardConfig controlling where we go next
* @throws IOException if an input/output error occurs
* @throws ServletException if a servlet exception occurs
*/
protected void processForwardConfig(HttpServletRequest request,
HttpServletResponse response, ForwardConfig forward)
throws IOException, ServletException {
if (forward == null) {
return;
}
if (log.isDebugEnabled()) {
log.debug("processForwardConfig(" + forward + ")");
}
String forwardPath = forward.getPath();
String uri;
// If the forward can be unaliased into an action, then use the path of the action
String actionIdPath = RequestUtils.actionIdURL(forward, request, servlet);
if (actionIdPath != null) {
forwardPath = actionIdPath;
ForwardConfig actionIdForward = new ForwardConfig(forward);
actionIdForward.setPath(actionIdPath);
forward = actionIdForward;
}
// paths not starting with / should be passed through without any
// processing (ie. they're absolute)
if (forwardPath.startsWith("/")) {
// get module relative uri
uri = RequestUtils.forwardURL(request, forward, null);
} else {
uri = forwardPath;
}
if (forward.getRedirect()) {
// only prepend context path for relative uri
if (uri.startsWith("/")) {
uri = request.getContextPath() + uri;
}
response.sendRedirect(response.encodeRedirectURL(uri));
} else {
doForward(uri, request, response);
}
}