Top Description Fields Constructors Methods
org.apache.catalina.manager

public Class JspHelper

extends Object
Class Inheritance
Imports
java.text.DateFormat, .NumberFormat, .SimpleDateFormat, java.util.Date, .Locale, org.apache.catalina.Session, org.apache.catalina.manager.util.SessionUtils, org.apache.tomcat.util.security.Escape

Helper JavaBean for JSPs, because JSTL 1.1/EL 2.0 is too dumb to to what I need (call methods with parameters), or I am too dumb to use it correctly. :)
Author
Cédrik LIME

Field Summary

Modifier and TypeField and Description
private static final String
private static final int
private static final char[][]

Constructor Summary

AccessConstructor and Description
private
JspHelper()

Public constructor, so that this class can be considered a JavaBean

Method Summary

Modifier and TypeMethod and Description
public static String
public static String

Returns:

the escaped XML
escapeXml
(String
The XML to escape
buffer
)

Performs the following substring replacements (to facilitate output to XML/HTML pages):

  • & -> &
  • < -> &lt;
  • > -> &gt;
  • " -> &#034;
  • ' -> &#039;
public static String
formatNumber(long number)

public static String
public static String
public static String
public static String
public static String
public static String

Returns:

String
guessDisplayLocaleFromSession
(Session
Session from which the locale should be guessed
in_session
)

Try to get user locale from the session, if possible.

public static String

Returns:

the user name
guessDisplayUserFromSession
(Session
The Servlet session
in_session
)

Try to get user name from the session, if possible.

private static String
public static String
secondsToTimeString(long in_seconds)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DATE_TIME_FORMATback to summary
private static final String DATE_TIME_FORMAT
HIGHEST_SPECIALback to summary
private static final int HIGHEST_SPECIAL
specialCharactersRepresentationback to summary
private static final char[][] specialCharactersRepresentation

Constructor Detail

JspHelperback to summary
private JspHelper()

Public constructor, so that this class can be considered a JavaBean

Method Detail

escapeXmlback to summary
public static String escapeXml(Object obj)
escapeXmlback to summary
public static String escapeXml(String buffer)

Performs the following substring replacements (to facilitate output to XML/HTML pages):

  • & -> &amp;
  • < -> &lt;
  • > -> &gt;
  • " -> &#034;
  • ' -> &#039;
Parameters
buffer:String

The XML to escape

Returns:String

the escaped XML

formatNumberback to summary
public static String formatNumber(long number)
getDisplayCreationTimeForSessionback to summary
public static String getDisplayCreationTimeForSession(Session in_session)
getDisplayInactiveTimeForSessionback to summary
public static String getDisplayInactiveTimeForSession(Session in_session)
getDisplayLastAccessedTimeForSessionback to summary
public static String getDisplayLastAccessedTimeForSession(Session in_session)
getDisplayTTLForSessionback to summary
public static String getDisplayTTLForSession(Session in_session)
getDisplayUsedTimeForSessionback to summary
public static String getDisplayUsedTimeForSession(Session in_session)
guessDisplayLocaleFromSessionback to summary
public static String guessDisplayLocaleFromSession(Session in_session)

Try to get user locale from the session, if possible.

Implementation Note

this method has explicit support for Tapestry 3 and Struts 1.x

Parameters
in_session:Session

Session from which the locale should be guessed

Returns:String

String

guessDisplayUserFromSessionback to summary
public static String guessDisplayUserFromSession(Session in_session)

Try to get user name from the session, if possible.

Parameters
in_session:Session

The Servlet session

Returns:String

the user name

localeToStringback to summary
private static String localeToString(Locale locale)
secondsToTimeStringback to summary
public static String secondsToTimeString(long in_seconds)