org.apache.struts2.views.util

## Class DefaultUrlHelper

- java.lang.Object
- - org.apache.struts2.views.util.DefaultUrlHelper

- All Implemented Interfaces:
    UrlHelper

      public class DefaultUrlHelper
      extends Object
      implements UrlHelper

  Default implementation of UrlHelper

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `HTTP_PROTOCOL`
    `static String` | `HTTPS_PROTOCOL`

    - ### Fields inherited from interface org.apache.struts2.views.util.UrlHelper

      `AMP, DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultUrlHelper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `buildUrl(String action, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> params)`
    `String` | `buildUrl(String action, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> params, String scheme, boolean includeContext, boolean encodeResult)`
    `String` | `buildUrl(String action, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> params, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort)`
    `String` | `buildUrl(String action, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> params, String urlScheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp)`
    `protected boolean` | `isValidScheme(String scheme)`
    `void` | `setHttpPort(String httpPort)`
    `void` | `setHttpsPort(String httpsPort)`
    `void` | `setQueryStringBuilder(QueryStringBuilder builder)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### HTTP_PROTOCOL

          public static final String HTTP_PROTOCOL

      See Also:
        Constant Field Values

    - #### HTTPS_PROTOCOL

          public static final String HTTPS_PROTOCOL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DefaultUrlHelper

          public DefaultUrlHelper()

  - ### Method Detail

    - #### setHttpPort

          public void setHttpPort(String httpPort)

    - #### setHttpsPort

          public void setHttpsPort(String httpsPort)

    - #### setQueryStringBuilder

          public void setQueryStringBuilder(QueryStringBuilder builder)

    - #### buildUrl

          public String buildUrl(String action,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 Map<String,Object> params)

      Specified by:
        `buildUrl` in interface `UrlHelper`

    - #### buildUrl

          public String buildUrl(String action,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 Map<String,Object> params,
                                 String scheme,
                                 boolean includeContext,
                                 boolean encodeResult)

      Specified by:
        `buildUrl` in interface `UrlHelper`

    - #### buildUrl

          public String buildUrl(String action,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 Map<String,Object> params,
                                 String scheme,
                                 boolean includeContext,
                                 boolean encodeResult,
                                 boolean forceAddSchemeHostAndPort)

      Specified by:
        `buildUrl` in interface `UrlHelper`

    - #### buildUrl

          public String buildUrl(String action,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 Map<String,Object> params,
                                 String urlScheme,
                                 boolean includeContext,
                                 boolean encodeResult,
                                 boolean forceAddSchemeHostAndPort,
                                 boolean escapeAmp)

      Specified by:
        `buildUrl` in interface `UrlHelper`

    - #### isValidScheme

          protected boolean isValidScheme(String scheme)

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.