public class StartupPageSupport extends Object
The startup page is delivered to the end user if any HTTP requests are received during the bootstrap process.
StartupServlet
,
LauncherContextListener
,
StartupProgressFilter
Constructor and Description |
---|
StartupPageSupport() |
Modifier and Type | Method and Description |
---|---|
static java.util.function.Function<String,String> |
getTranslator(javax.servlet.http.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(javax.servlet.http.HttpServletRequest request)
Returns
true if the provided request targets the startup page. |
static boolean |
isStartupPage(javax.servlet.ServletRequest request)
Returns
true if the provided request targets the startup page. |
static void |
redirectToStartupPage(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Redirects from the current page to
startup.jsp . |
static void |
returnFromStartupJsp(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Redirects from
startup.jsp to the original page. |
static void |
setLaunched(boolean launched)
Used to mark JIRA as fully launched
|
public static boolean isLaunched()
true
if JIRA's servlet context is still initializingtrue
if JIRA's servlet context is still initializingpublic static void setLaunched(boolean launched)
public static boolean isStartupPage(javax.servlet.ServletRequest request)
true
if the provided request targets the startup page.request
- the current requesttrue
if the provided request targets the startup page; false
if it is anything else.public static boolean isStartupPage(javax.servlet.http.HttpServletRequest request)
true
if the provided request targets the startup page.request
- the current requesttrue
if the provided request targets the startup page; false
if it is anything else.public static void redirectToStartupPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
startup.jsp
.request
- the current HTTP requestresponse
- the current HTTP responseIOException
- if something goes wrong when sending the redirect (probably because the client disconnected)public static void returnFromStartupJsp(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
startup.jsp
to the original page.request
- the current HTTP requestresponse
- the current HTTP responseIOException
- if something goes wrong when sending the redirect (probably because the client disconnected)public static java.util.function.Function<String,String> getTranslator(javax.servlet.http.HttpServletRequest request)
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.
request
- the servlet request that wants a translated stringCopyright © 2002-2017 Atlassian. All Rights Reserved.