Package edu.wisc.game.web
Class ContextInfo
java.lang.Object
edu.wisc.game.web.ResultsBase
edu.wisc.game.web.ContextInfo
- Direct Known Subclasses:
FrontEndForm2
public class ContextInfo extends ResultsBase
Prepares some information needed for proper URL construction in
our app.
-
Field Summary
Fields Modifier and Type Field Description String
clientUrl
The main GUI Client URL to use (dev or prod).String
cp
boolean
dev
True if we're to use the dev version of the GUI client rather than the prod one.String
exp
Optional; used in some pages.String
host
int
port
String
serverUrl
The Game Server URL for REST calls (based on the HTTP request we have just received). -
Constructor Summary
Constructors Constructor Description ContextInfo(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
Note that request.getProtocol() is not helpful to distinguish HTTP from HTTPS, as it seems to always return "HTTP". -
Method Summary
Modifier and Type Method Description String
devProd()
Do we use the "dev" or "prod" client?String
getVersion()
Methods inherited from class edu.wisc.game.web.ResultsBase
exceptionTrace, getDisplayText, getErrmsg, getError, getEx, giveError, giveError, loggedIn, setErrmsg, setError
-
Field Details
-
host
-
port
public int port -
cp
-
dev
public boolean devTrue if we're to use the dev version of the GUI client rather than the prod one. (This flag comes from the URL query string, dev=true, and controls the choice of the clientUrl). -
serverUrl
The Game Server URL for REST calls (based on the HTTP request we have just received). This can be passed to the GUI client so that it would be using our Game Server (and not a Game Server somewhere else). The value is, for example, http://localhost:8080/w2020-dev or https://rulegame.wisc.edu/w2020 -
clientUrl
The main GUI Client URL to use (dev or prod). It normally comes from the master config file. -
exp
Optional; used in some pages. More usually, null.
-
-
Constructor Details
-
ContextInfo
public ContextInfo(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Note that request.getProtocol() is not helpful to distinguish HTTP from HTTPS, as it seems to always return "HTTP". OTOH, using port 443 is a good indicator of HTTPS being used.
-
-
Method Details
-
devProd
Do we use the "dev" or "prod" client? -
getVersion
-