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 int DEFAULT_HTTP_PORT
          Default HTTP port (80).
private static int DEFAULT_HTTPS_PORT
          Default HTTPS port (443).
private static Logger LOG
           
 
Constructor Summary
UrlHelper()
           
 
Method Summary
static void buildParametersString(Map params, StringBuilder link)
           
static void buildParametersString(Map params, StringBuilder link, String paramSeparator)
           
private static String buildParameterSubstring(String name, String value)
           
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 Map parseQueryString(String queryString, boolean forceValueArray)
           
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 Logger 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
Constructor Detail

UrlHelper

public UrlHelper()
Method Detail

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,
                                         StringBuilder link)

buildParametersString

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

buildParameterSubstring

private static String buildParameterSubstring(String name,
                                              String value)

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)

parseQueryString

public static Map parseQueryString(String queryString,
                                   boolean forceValueArray)


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