JspHelper (Apache Tomcat 11.0.22 API Documentation)
Description: declaration: package: org.apache.catalina.manager, class: JspHelper

# Class JspHelper

java.lang.Object
org.apache.catalina.manager.JspHelper

public class JspHelper extends Object
Helper JavaBean for JSPs, because JSTL 1.1/EL 2.0 is too dumb to do what I need (call methods with parameters), or I am too dumb to use it correctly. :)

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `escapeXml(Object obj)`
  `static String`
  `escapeXml(String buffer)`
  Performs the following substring replacements (to facilitate output to XML/HTML pages): & -> &amp; < -> &lt; > -> &gt; " -> &#034; ' -> &#039;
  `static String`
  `formatNumber(long number)`
  `static String`
  `getDisplayCreationTimeForSession(Session in_session)`
  `static String`
  `getDisplayInactiveTimeForSession(Session in_session)`
  `static String`
  `getDisplayLastAccessedTimeForSession(Session in_session)`
  `static String`
  `getDisplayTTLForSession(Session in_session)`
  `static String`
  `getDisplayUsedTimeForSession(Session in_session)`
  `static String`
  `guessDisplayLocaleFromSession(Session in_session)`
  Try to get user locale from the session, if possible.
  `static String`
  `guessDisplayUserFromSession(Session in_session)`
  Try to get username from the session, if possible.
  `static String`
  `secondsToTimeString(long in_seconds)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### guessDisplayLocaleFromSession

    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 from which the locale should be guessed
    Returns:
      String

  - ### guessDisplayUserFromSession

    public static String guessDisplayUserFromSession(Session in_session)
    Try to get username from the session, if possible.
    Parameters:
      `in_session` - The Servlet session
    Returns:
      the username

  - ### getDisplayCreationTimeForSession

    public static String getDisplayCreationTimeForSession(Session in_session)

  - ### getDisplayLastAccessedTimeForSession

    public static String getDisplayLastAccessedTimeForSession(Session in_session)

  - ### getDisplayUsedTimeForSession

    public static String getDisplayUsedTimeForSession(Session in_session)

  - ### getDisplayTTLForSession

    public static String getDisplayTTLForSession(Session in_session)

  - ### getDisplayInactiveTimeForSession

    public static String getDisplayInactiveTimeForSession(Session in_session)

  - ### secondsToTimeString

    public static String secondsToTimeString(long in_seconds)

  - ### escapeXml

    public static String escapeXml(Object obj)

  - ### escapeXml

    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` - The XML to escape
    Returns:
      the escaped XML

  - ### formatNumber

    public static String formatNumber(long number)