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 Details

    • host

      public String host
    • port

      public int port
    • cp

      public String cp
    • dev

      public boolean dev
      True 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

      public String 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

      public String clientUrl
      The main GUI Client URL to use (dev or prod). It normally comes from the master config file.
    • exp

      public String 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