Package edu.wisc.game.web
Class ContextInfo
java.lang.Object
edu.wisc.game.web.ResultsBase
edu.wisc.game.web.ContextInfo
- Direct Known Subclasses:
FrontEndForm2
Prepares some information needed for proper URL construction in
our app.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe main GUI Client URL to use (dev or prod).boolean
True if we're to use the dev version of the GUI client rather than the prod one.Optional; used in some pages.int
int
int
The Game Server URL for REST calls (based on the HTTP request we have just received).Fields inherited from class edu.wisc.game.web.ResultsBase
displayName, infomsg, uid
-
Constructor Summary
ConstructorsConstructorDescriptionContextInfo
(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
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 -
serverPort
public int serverPort -
localPort
public int localPort -
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.We use getServerPort() rather than getLocalPort() because it's more helpful in the situation when a firewall with port forwarding is used. E.g. when the (external) port 80 is forwarded by the firewall to port 1234 (as it is the case on the DIMACS host), getServerPort() will still give us 80.
-
-
Method Details
-
devProd
Do we use the "dev" or "prod" client? -
getVersion
-