public class

StartupPageSupport

extends Object
java.lang.Object
   ↳ com.atlassian.jira.web.startup.StartupPageSupport

Class Overview

Static infrastructure related to the startup page, including filtering, constants, redirects, etc.

The startup page is delivered to the end user if any HTTP requests are received during the bootstrap process.

Summary

Public Constructors
StartupPageSupport()
Public Methods
static Function<StringString> getTranslator(HttpServletRequest request)
Obtains a simple translation function for mapping message keys to translated text.
static boolean isLaunched()
Returns true if JIRA's servlet context is still initializing
static boolean isStartupPage(ServletRequest request)
Returns true if the provided request targets the startup page.
static boolean isStartupPage(HttpServletRequest request)
Returns true if the provided request targets the startup page.
static void redirectToStartupPage(HttpServletRequest request, HttpServletResponse response)
Redirects from the current page to startup.jsp.
static void returnFromStartupJsp(HttpServletRequest request, HttpServletResponse response)
Redirects from startup.jsp to the original page.
static void setLaunched(boolean launched)
Used to mark JIRA as fully launched
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StartupPageSupport ()

Public Methods

public static Function<StringString> getTranslator (HttpServletRequest request)

Obtains a simple translation function for mapping message keys to translated text.

The locale is taken from the current request instead of the normal JIRA pattern of using a setting from the user's preferences or application properties because during startup those kinds of things may or may not be available, and changing what language is displayed for the same user in the same web browser would be very surprising, especially since the use of AJAX means that the same page would end up displaying more than one language at a time. It seems safest to just guess the locale based on the Accept-Language header from the user's browser, instead.

Note: These translations can only be provided by the special StartupPageSupport properties files and cannot be added to or altered by plugins (including language packs). What we build into JIRA is all you get.

Parameters
request the servlet request that wants a translated string
Returns
  • the translated string

public static boolean isLaunched ()

Returns true if JIRA's servlet context is still initializing

Returns
  • true if JIRA's servlet context is still initializing

public static boolean isStartupPage (ServletRequest request)

Returns true if the provided request targets the startup page.

Parameters
request the current request
Returns
  • true if the provided request targets the startup page; false if it is anything else.

public static boolean isStartupPage (HttpServletRequest request)

Returns true if the provided request targets the startup page.

Parameters
request the current request
Returns
  • true if the provided request targets the startup page; false if it is anything else.

public static void redirectToStartupPage (HttpServletRequest request, HttpServletResponse response)

Redirects from the current page to startup.jsp.

Parameters
request the current HTTP request
response the current HTTP response
Throws
IOException if something goes wrong when sending the redirect (probably because the client disconnected)

public static void returnFromStartupJsp (HttpServletRequest request, HttpServletResponse response)

Redirects from startup.jsp to the original page.

Parameters
request the current HTTP request
response the current HTTP response
Throws
IOException if something goes wrong when sending the redirect (probably because the client disconnected)

public static void setLaunched (boolean launched)

Used to mark JIRA as fully launched