Class ServletUrlRenderer

java.lang.Object
org.apache.struts2.components.ServletUrlRenderer
All Implemented Interfaces:
UrlRenderer

public class ServletUrlRenderer extends Object implements UrlRenderer
Implementation of the UrlRenderer interface that creates URLs suitable in a servlet environment.
  • Constructor Details

    • ServletUrlRenderer

      public ServletUrlRenderer()
  • Method Details

    • setActionMapper

      public void setActionMapper(ActionMapper mapper)
      Specified by:
      setActionMapper in interface UrlRenderer
    • setUrlHelper

      public void setUrlHelper(UrlHelper urlHelper)
    • setQueryStringParser

      public void setQueryStringParser(QueryStringParser queryStringParser)
    • renderUrl

      public void renderUrl(Writer writer, UrlProvider urlComponent)
      Render a URL.
      Specified by:
      renderUrl in interface UrlRenderer
      Parameters:
      writer - A writer that the implementation can use to write the result to.
      urlComponent - The UrlProvider component that "owns" this renderer.
    • renderFormUrl

      public void renderFormUrl(Form formComponent)
      Render a Form URL.
      Specified by:
      renderFormUrl in interface UrlRenderer
      Parameters:
      formComponent - The Form component that "owns" this renderer.
    • beforeRenderUrl

      public void beforeRenderUrl(UrlProvider urlComponent)
      Description copied from interface: UrlRenderer
      Preprocessing step
      Specified by:
      beforeRenderUrl in interface UrlRenderer
      Parameters:
      urlComponent - The UrlProvider component that "owns" this renderer.
    • mergeRequestParameters

      protected QueryStringParser.Result mergeRequestParameters(String value, Map<String,Object> parameters, Map<String,?> contextParameters)
      Merge request parameters into current parameters. If a parameter is already present, than the request parameter in the current request and value attribute will not override its value.

      The priority is as follows:-

      • parameter from the current request (least priority)
      • parameter form the value attribute (more priority)
      • parameter from the param tag (most priority)
      Parameters:
      value - the value attribute (URL to be generated by this component)
      parameters - component parameters
      contextParameters - request parameters
      Returns:
      QueryStringParser.Result of value's ?query-string or empty()