org.apache.struts2.views.util
Class UrlHelper

java.lang.Object
  extended by org.apache.struts2.views.util.UrlHelper

public class UrlHelper
extends Object

UrlHelper


Field Summary
private static String AMP
           
private static String customEncoding
           
private static int DEFAULT_HTTP_PORT
          Default HTTP port (80).
private static int DEFAULT_HTTPS_PORT
          Default HTTPS port (443).
private static int httpPort
           
private static int httpsPort
           
private static Log LOG
           
 
Constructor Summary
UrlHelper()
           
 
Method Summary
static void buildParametersString(Map params, StringBuffer link)
           
static void buildParametersString(Map params, StringBuffer link, String paramSeparator)
           
static String buildUrl(String action, HttpServletRequest request, HttpServletResponse response, Map params)
           
static String buildUrl(String action, HttpServletRequest request, HttpServletResponse response, Map params, String scheme, boolean includeContext, boolean encodeResult)
           
static String buildUrl(String action, HttpServletRequest request, HttpServletResponse response, Map params, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort)
           
static String buildUrl(String action, HttpServletRequest request, HttpServletResponse response, Map params, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp)
           
private static String getEncodingFromConfiguration()
           
static Map parseQueryString(String queryString)
           
static void setCustomEncoding(String val)
           
static void setHttpPort(String val)
           
static void setHttpsPort(String val)
           
static String translateAndDecode(String input)
           
static String translateAndEncode(String input)
          Translates any script expressions using TextParseUtil.translateVariables(java.lang.String, com.opensymphony.xwork2.util.ValueStack) and encodes the URL using URLEncoder.encode(java.lang.String) with the encoding specified in the configuration.
private static String translateVariable(String input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

DEFAULT_HTTP_PORT

private static final int DEFAULT_HTTP_PORT
Default HTTP port (80).

See Also:
Constant Field Values

DEFAULT_HTTPS_PORT

private static final int DEFAULT_HTTPS_PORT
Default HTTPS port (443).

See Also:
Constant Field Values

AMP

private static final String AMP
See Also:
Constant Field Values

httpPort

private static int httpPort

httpsPort

private static int httpsPort

customEncoding

private static String customEncoding
Constructor Detail

UrlHelper

public UrlHelper()
Method Detail

setHttpPort

public static void setHttpPort(String val)

setHttpsPort

public static void setHttpsPort(String val)

setCustomEncoding

public static void setCustomEncoding(String val)

buildUrl

public static String buildUrl(String action,
                              HttpServletRequest request,
                              HttpServletResponse response,
                              Map params)

buildUrl

public static String buildUrl(String action,
                              HttpServletRequest request,
                              HttpServletResponse response,
                              Map params,
                              String scheme,
                              boolean includeContext,
                              boolean encodeResult)

buildUrl

public static String buildUrl(String action,
                              HttpServletRequest request,
                              HttpServletResponse response,
                              Map params,
                              String scheme,
                              boolean includeContext,
                              boolean encodeResult,
                              boolean forceAddSchemeHostAndPort)

buildUrl

public static String buildUrl(String action,
                              HttpServletRequest request,
                              HttpServletResponse response,
                              Map params,
                              String scheme,
                              boolean includeContext,
                              boolean encodeResult,
                              boolean forceAddSchemeHostAndPort,
                              boolean escapeAmp)

buildParametersString

public static void buildParametersString(Map params,
                                         StringBuffer link)

buildParametersString

public static void buildParametersString(Map params,
                                         StringBuffer link,
                                         String paramSeparator)

translateAndEncode

public static String translateAndEncode(String input)
Translates any script expressions using TextParseUtil.translateVariables(java.lang.String, com.opensymphony.xwork2.util.ValueStack) and encodes the URL using URLEncoder.encode(java.lang.String) with the encoding specified in the configuration.

Parameters:
input -
Returns:
the translated and encoded string

translateAndDecode

public static String translateAndDecode(String input)

translateVariable

private static String translateVariable(String input)

getEncodingFromConfiguration

private static String getEncodingFromConfiguration()

parseQueryString

public static Map parseQueryString(String queryString)


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.