| java.lang.Object org.ofbiz.base.util.UtilHttp
Method Summary | |
public static String | getApplicationName(HttpServletRequest request) | public static String | getContentTypeByFileName(String fileName) | public static String | getCurrencyUom(HttpSession session) Get the currency string from the session. | public static String | getCurrencyUom(HttpServletRequest request) Get the currency string from the session. | public static StringBuffer | getFullRequestUrl(HttpServletRequest request) | public static Locale | getLocale(HttpServletRequest request) | public static Locale | getLocale(HttpSession session) Get the Locale object from a session variable; if not found use the system's default. | public static Map | getParameterMap(HttpServletRequest request) | public static StringBuffer | getServerRootUrl(HttpServletRequest request) | public static List | makeParamListWithSuffix(HttpServletRequest request, String suffix, String prefix) | public static Map | makeParamMapWithPrefix(HttpServletRequest request, String prefix, String suffix) | public static void | parametersToAttributes(HttpServletRequest request) Put request parameters in request object as attributes. | public static void | setCurrencyUom(HttpServletRequest request, String currencyUom) | public static void | setLocale(HttpServletRequest request, String localeString) | public static void | setLocale(HttpServletRequest request, Locale locale) | public static String | setResponseBrowserProxyNoCache(HttpServletRequest request, HttpServletResponse response) | public static void | setResponseBrowserProxyNoCache(HttpServletResponse response) | public static String | setSessionCurrencyUom(HttpServletRequest request, HttpServletResponse response) | public static String | setSessionLocale(HttpServletRequest request, HttpServletResponse response) | public static void | streamContent(OutputStream out, InputStream in, int length) | public static void | streamContentToBrowser(HttpServletResponse response, byte[] bytes, String contentType) | public static void | streamContentToBrowser(HttpServletResponse response, InputStream in, int length, String contentType) | public static String | urlEncodeArgs(Map args) |
getApplicationName | public static String getApplicationName(HttpServletRequest request)(Code) | | Given a request, returns the application name or "root" if deployed on root
Parameters: request - An HttpServletRequest to get the name info from String |
getContentTypeByFileName | public static String getContentTypeByFileName(String fileName)(Code) | | |
getCurrencyUom | public static String getCurrencyUom(HttpSession session)(Code) | | Get the currency string from the session.
Parameters: session - HttpSession object to use for lookup String The ISO currency code |
getCurrencyUom | public static String getCurrencyUom(HttpServletRequest request)(Code) | | Get the currency string from the session.
Parameters: request - HttpServletRequest object to use for lookup String The ISO currency code |
getLocale | public static Locale getLocale(HttpServletRequest request)(Code) | | Get the Locale object from a session variable; if not found use the browser's default
Parameters: request - HttpServletRequest object to use for lookup Locale The current Locale to use |
getLocale | public static Locale getLocale(HttpSession session)(Code) | | Get the Locale object from a session variable; if not found use the system's default.
NOTE: This method is not recommended because it ignores the Locale from the browser not having the request object.
Parameters: session - HttpSession object to use for lookup Locale The current Locale to use |
getParameterMap | public static Map getParameterMap(HttpServletRequest request)(Code) | | Create a map from an HttpServletRequest object
The resulting Map |
parametersToAttributes | public static void parametersToAttributes(HttpServletRequest request)(Code) | | Put request parameters in request object as attributes.
Parameters: request - |
setCurrencyUom | public static void setCurrencyUom(HttpServletRequest request, String currencyUom)(Code) | | Simple event to set the users per-session currency uom value
|
streamContent | public static void streamContent(OutputStream out, InputStream in, int length) throws IOException(Code) | | Stream binary content from InputStream to OutputStream
This method does not close the streams passed
Parameters: out - OutputStream content should go to Parameters: in - InputStream of the actual content Parameters: length - Size (in bytes) of the content throws: IOException - |
streamContentToBrowser | public static void streamContentToBrowser(HttpServletResponse response, byte[] bytes, String contentType) throws IOException(Code) | | Stream an array of bytes to the browser
This method will close the ServletOutputStream when finished
Parameters: response - HttpServletResponse object to get OutputStream from Parameters: bytes - Byte array of content to stream Parameters: contentType - The content type to pass to the browser throws: IOException - |
streamContentToBrowser | public static void streamContentToBrowser(HttpServletResponse response, InputStream in, int length, String contentType) throws IOException(Code) | | Streams content from InputStream to the ServletOutputStream
This method will close the ServletOutputStream when finished
This method does not close the InputSteam passed
Parameters: response - HttpServletResponse object to get OutputStream from Parameters: in - InputStream of the actual content Parameters: length - Size (in bytes) of the content Parameters: contentType - The content type to pass to the browser throws: IOException - |
urlEncodeArgs | public static String urlEncodeArgs(Map args)(Code) | | URL Encodes a Map of arguements
|
|
|