code: public static String getRewrittenActionURI( ServletContext servletContext, HttpServletRequest request,
                                                  HttpServletResponse response, String actionName, Map params,
                                                  String fragment, boolean forXML )
              throws URISyntaxException
      {
          MutableURI uri = getActionURI( servletContext, request, response, actionName );
          if ( params != null ) uri.addParameters( params, false );
          if ( fragment != null ) uri.setFragment( uri.encode( fragment ) );
  
          boolean needsToBeSecure = needsToBeSecure( servletContext, request, uri.getPath(), true );
          URLRewriterService.rewriteURL( servletContext, request, response, uri, URLType.ACTION, needsToBeSecure );
          String key = getURLTemplateKey( URLType.ACTION, needsToBeSecure );
          URIContext uriContext = URIContextFactory.getInstance( forXML );
  
          return URLRewriterService.getTemplatedURL( servletContext, request, uri, key, uriContext );
      }
docs: Create a fully-rewritten URI given an action name and parameters.
  
  @param servletContext the current ServletContext.
  @param request the current HttpServletRequest.
  @param response the current HttpServletResponse.
  @param actionName the action name to convert into a fully-rewritten URI; may be qualified with a path from the
  webapp root, in which case the parent directory from the current request is <i>not</i> used.
  @param params the additional parameters to include in the URI query.
  @param fragment the fragment (anchor or location) for this url.
  @param forXML flag indicating that the query of the uri should be written
  using the &quot;&amp;amp;&quot; entity, rather than the character, '&amp;'.
  @return a fully-rewritten URI for the given action.
  @throws URISyntaxException if there is a problem converting the action URI (derived
  from processing the given action name) into a MutableURI.