| java.lang.Object org.openlaszlo.utils.LZHttpUtils
LZHttpUtils | public class LZHttpUtils (Code) | | Utility class for http servlets
|
Method Summary | |
public static boolean | allowForward(String header, Enumeration connEnum) From RFC2616, 14.10:
HTTP/1.1 proxies MUST parse the Connection header field before a message
is forwarded and, for each connection-token in this field, remove any
header field(s) from the message with the same name as the
connection-token. | public static String | getCookie(HttpServletRequest req, String name) Fetch cookie value for a particular cookie name. | public static long | getDate(String s) | public static String | getDateString(long d) | public static String | getRealPath(ServletContext ctxt, String path) Replace real path forward slash characters to back-slash for Windoze.
This is to get around a WebSphere problem (see bug 988). | public static String | getRealPath(ServletContext ctxt, HttpServletRequest req) Replace real path forward slash characters to back-slash for Windoze. | public static URL | getRequestURL(HttpServletRequest req) | public static String | modifyWEBAPP(HttpServletRequest req, String url) If a URL contains /@WEBAPP@ , replaces that string with
context path. | public static URI | newURI(String s) | public static void | noStore(HttpServletResponse res) | public static void | proxyRequestHeaders(HttpServletRequest req, HttpMethodBase method) Add request headers into method. | public static void | proxyResponseHeaders(HttpMethodBase meth, HttpServletResponse res, boolean isSecure) Pull response headers from method and put into
servlet response object. | public static String | urldecode(String s, String enc) Decodes a urlencoded string using a specific charset encoding. |
ACCEPT_ENCODING | final public static String ACCEPT_ENCODING(Code) | | |
CONTENT_ENCODING | final public static String CONTENT_ENCODING(Code) | | |
CONTENT_LENGTH | final public static String CONTENT_LENGTH(Code) | | |
IF_MODIFIED_SINCE | final public static String IF_MODIFIED_SINCE(Code) | | |
TRANSFER_ENCODING | final public static String TRANSFER_ENCODING(Code) | | |
allowForward | public static boolean allowForward(String header, Enumeration connEnum)(Code) | | From RFC2616, 14.10:
HTTP/1.1 proxies MUST parse the Connection header field before a message
is forwarded and, for each connection-token in this field, remove any
header field(s) from the message with the same name as the
connection-token. Connection options are signaled by the presence of a
connection-token in the Connection header field, not by any corresponding
additional header field(s), since the additional header field may not be
sent if there are no parameters associated with that connection
option.
|
getCookie | public static String getCookie(HttpServletRequest req, String name)(Code) | | Fetch cookie value for a particular cookie name.
Parameters: req - servlet request. Parameters: name - name of cookie key to fetch. |
getDate | public static long getDate(String s)(Code) | | Convert an HTTP Date String to a long
the long or -1 if the string doesn't parse correctly. |
getDateString | public static String getDateString(long d)(Code) | | Convert a long utc value to an HTTP Date String (TZ must be GMT)
|
getRealPath | public static String getRealPath(ServletContext ctxt, String path)(Code) | | Replace real path forward slash characters to back-slash for Windoze.
This is to get around a WebSphere problem (see bug 988). Note that if the
web application content is being served directly from a .war file, this
method will return null. See ServletContext.getRealPath() for more
details.
Parameters: ctxt - servlet context Parameters: path - virtual webapp path to resolve into a real path the real path, or null if the translation cannot be performed |
getRealPath | public static String getRealPath(ServletContext ctxt, HttpServletRequest req)(Code) | | Replace real path forward slash characters to back-slash for Windoze.
Parameters: ctxt - servlet context Parameters: req - generating request the real path, or null if the translation cannot be performed |
getRequestURL | public static URL getRequestURL(HttpServletRequest req)(Code) | | the URL for the request // with the query string? Parameters: req - the request |
modifyWEBAPP | public static String modifyWEBAPP(HttpServletRequest req, String url)(Code) | | If a URL contains /@WEBAPP@ , replaces that string with
context path. If context path is / , the function just
removes the /@WEBAPP@ string.
Parameters: url - URL to check if /@WEBAPP@ token exists. if /@WEBAPP@ exists, new modified URL else old URL. |
newURI | public static URI newURI(String s) throws URIException(Code) | | Return a URI object, escaping input only if needed
|
proxyRequestHeaders | public static void proxyRequestHeaders(HttpServletRequest req, HttpMethodBase method)(Code) | | Add request headers into method.
Parameters: req - http servlet request object Parameters: method - method to insert request headers into |
proxyResponseHeaders | public static void proxyResponseHeaders(HttpMethodBase meth, HttpServletResponse res, boolean isSecure)(Code) | | Pull response headers from method and put into
servlet response object.
Parameters: method - method to proxy from Parameters: res - http servlet response object to proxy to Parameters: isSecure - true if get method is secure |
|
|