|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.web.Util
public abstract class Util
Provides convenience functions for web-based interfaces.
| Nested Class Summary | |
|---|---|
static class |
Util.IgnoreType
|
| Field Summary | |
|---|---|
protected static java.lang.Boolean |
usePortInBaseUrls
Internal flag used to cache a servlet context parameter |
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
calculateUrlBase(javax.servlet.http.HttpServletRequest request)
Return a string that represents the fully qualified URL for our servlet context, suitable for use in the HTML base tag. |
static org.opennms.netmgt.utils.EventProxy |
createEventProxy()
|
static java.lang.String |
decode(java.lang.String string)
Encapsulate the deprecated decode method to fix it in one place. |
static java.lang.String |
encode(java.lang.String string)
Encapsulate the deprecated encode method to fix it in one place. |
static java.lang.String |
formatDateToUIString(java.util.Date date)
An utility method to format a 'Date' into a string in the local specific DEFALUT DateFormat style for both the date and time. |
static java.lang.String |
getHostname(java.lang.String ipAddress)
Deprecated. Please use NetworkElementFactory.getHostname instead. |
static java.util.Map<java.lang.String,java.lang.String> |
getOrderedMap(java.lang.String[][] names)
|
static java.lang.String |
htmlify(java.lang.String input)
|
static java.lang.String |
makeHiddenTags(javax.servlet.http.HttpServletRequest request)
Creates hidden tags for all the parameters given in the request. |
static java.lang.String |
makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.util.Map additions)
Creates hidden tags for all the parameters given in the request. |
static java.lang.String |
makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores)
Creates hidden tags for all the parameters given in the request plus the additions, except for the parameters and additions listed in the ignore list. |
static java.lang.String |
makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores,
Util.IgnoreType ignoreType)
Creates hidden tags for all the parameters given in the request plus the additions, except for the parmeters listed in the ignore list. |
static java.lang.String |
makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.lang.String[] ignores)
Creates hidden tags for all the parameters given in the request. |
static java.lang.String |
makeQueryString(javax.servlet.http.HttpServletRequest request)
Creates a query string of the format "key1=value1&key2=value2" for each parameter in the given HttpServletRequest. |
static java.lang.String |
makeQueryString(javax.servlet.http.HttpServletRequest request,
java.util.Map additions)
Creates a query string of the format "key1=value1&key2=value2" for each parameter in the given HttpServletRequest and key in
given Map. |
static java.lang.String |
makeQueryString(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores)
Creates a query string of the format "key1=value1&key2=value2" for each parameter in the given HttpServletRequest and key in
given Map that is not listed in the ignore list. |
static java.lang.String |
makeQueryString(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores,
Util.IgnoreType ignoreType)
Creates a query string of the format "key1=value1&key2=value2" for each parameter in the given HttpServletRequest and key in
given Map that is not listed in the ignore list. |
static java.lang.String |
makeQueryString(javax.servlet.http.HttpServletRequest request,
java.lang.String[] ignores)
Creates a query string of the format "key1=value1&key2=value2" for each parameter in the given HttpServletRequest that is not
listed in the ignore list. |
static java.lang.String |
resolveIpAddress(java.lang.String ipAddress)
Deprecated. Please use NetworkElementFactory.getHostname instead. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.lang.Boolean usePortInBaseUrls
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static java.lang.String calculateUrlBase(javax.servlet.http.HttpServletRequest request)
As an example, suppose your host was www.mycompany.com, you are serving
from port 80, and your web application name was "opennms," then this
method would return: http://www.mycompany.com:80/opennms/
request - the servlet request you are servicingpublic static java.lang.String getHostname(java.lang.String ipAddress)
NetworkElementFactory.getHostname instead.
ipAddress - the IP address for which you want the hostnamepublic static java.lang.String encode(java.lang.String string)
string - string to be encoded
public static java.lang.String decode(java.lang.String string)
string - string to be decoded
public static java.lang.String resolveIpAddress(java.lang.String ipAddress)
NetworkElementFactory.getHostname instead.
ipAddress - the IP address for which you want the hostnamepublic static java.lang.String makeHiddenTags(javax.servlet.http.HttpServletRequest request)
request - the HttpServletRequest to read the parameters
from
paramName" value=" paramValue"
/> tag for each parameter.
public static java.lang.String makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.util.Map additions)
request - the HttpServletRequest to read the parameters
fromadditions - a map of extra parameters to create hidden tags for
paramName" value=" paramValue"
/> tag for each parameter.
public static java.lang.String makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.lang.String[] ignores)
request - the HttpServletRequest to read the parameters
fromignores - A string array containing request parameters to ignore
paramName" value=" paramValue"
/> tag for each parameter.
public static java.lang.String makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores)
request - the HttpServletRequest to read the parameters
fromadditions - a map of extra parameters to create hidden tags forignores - the list of parameters not to create a hidden tag for
paramName" value=" paramValue"
/> tag for each parameter not in the ignore list.
public static java.lang.String makeHiddenTags(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores,
Util.IgnoreType ignoreType)
request - the HttpServletRequest to read the parameters
fromadditions - a map of extra parameters to create hidden tags forignores - the list of parameters not to create a hidden tag forignoreType - whether the ignore list applies to the request parameters,
values in the additions map, or both
paramName" value=" paramValue"
/> tag for each parameter not in the ignore list.public static java.lang.String makeQueryString(javax.servlet.http.HttpServletRequest request)
HttpServletRequest.
makeQueryString( HttpServletRequest, Map, String[] )
public static java.lang.String makeQueryString(javax.servlet.http.HttpServletRequest request,
java.util.Map additions)
HttpServletRequest and key in
given Map.
makeQueryString( HttpServletRequest, Map, String[] )
public static java.lang.String makeQueryString(javax.servlet.http.HttpServletRequest request,
java.lang.String[] ignores)
HttpServletRequest that is not
listed in the ignore list.
makeQueryString( HttpServletRequest, Map, String[] )
public static java.lang.String makeQueryString(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores)
HttpServletRequest and key in
given Map that is not listed in the ignore list.
request - the HttpServletRequest to read the parameters
fromadditions - a mapping of strings to strings or string arrays to be
included in the query stringignores - the list of parameters and map entries not to include
public static java.lang.String makeQueryString(javax.servlet.http.HttpServletRequest request,
java.util.Map additions,
java.lang.String[] ignores,
Util.IgnoreType ignoreType)
HttpServletRequest and key in
given Map that is not listed in the ignore list.
request - the HttpServletRequest to read the parameters
fromadditions - a mapping of strings to strings or string arrays to be
included in the query stringignores - the list of parameters and map entries not to include
public static java.util.Map<java.lang.String,java.lang.String> getOrderedMap(java.lang.String[][] names)
public static java.lang.String htmlify(java.lang.String input)
public static org.opennms.netmgt.utils.EventProxy createEventProxy()
public static final java.lang.String formatDateToUIString(java.util.Date date)
DateFormat
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||