public final class StartupPageSupport extends Object
The startup page is delivered to the end user if any HTTP requests are received during the bootstrap process, to prevent Pico deadlocks or similar problems.
StartupServlet
,
LauncherContextListener
,
StartupProgressFilter
Modifier and Type | Field and Description |
---|---|
static String |
STARTUP_JSP |
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()
Indicates whether JIRA is fully launched, in other words, it is safe to let
requests hit JIRA itself rather than the startup page.
|
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)
Marks JIRA as fully launched, in other words ready to handle requests.
|
public static final String STARTUP_JSP
public static boolean isLaunched()
setLaunched(boolean)
public static void setLaunched(boolean launched)
isLaunched()
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-2019 Atlassian. All Rights Reserved.