public final class App extends Object implements HasHandlers
Constructor and Description |
---|
App() |
Modifier and Type | Method and Description |
---|---|
void |
fireEvent(GwtEvent<?> e) |
(package private) static void |
forceInitClass()
Does nothing itself but the call forces static initialization of this class.
|
static String |
getMirroredContextLocation()
The URL of the vote-server's context on the static mirror, or null if the context
is not statically mirrored.
|
static String |
getServletContextLocation()
The URL of the vote-server's context on the servlet container (Tomcat), without a
trailing slash (/).
|
static String |
getUsername()
The name of the authenticated user if known, otherwise null.
|
static App |
i()
The single instance of App.
|
JsonpRequestBuilder |
jsonp()
A common JSONP request builder with a default configuration.
|
JsonpRequestBuilder |
jsonpWAP()
A common JSONP request builder configured for WAP requests.
|
A |
mesA()
The localized messages for package a.
|
S |
mesS()
The localized messages for package s.
|
PollwikiG |
pollwiki()
The pollwiki associated with the vote-server.
|
static void |
setMirroredContextLocation(String s)
Sets the URL of the vote-server's context on the static mirror.
|
static void |
setServletContextLocation(String s)
Sets the URL of the vote-server's context on the servlet container (Tomcat).
|
static void |
setUsername(String newUsername)
Sets the name of the authenticated user.
|
String |
staticContextLocation()
Returns the preferred location for fetching static files.
|
public App()
static void forceInitClass()
@GWTConfigCallback public static String getMirroredContextLocation()
@GWTConfigCallback public static void setMirroredContextLocation(String s)
a_web_gwt_App_setMirroredContextLocation( 'http://HOST-NAME/PATH' ); // default is null, meaning no static mirror
The default value is appropriate for an out-of-the-box test deployment in a servlet container such as Tomcat or Jetty. For an online vote-server it is often more flexible and efficient to serve the static web pages (like CONTEXT/xf/default.html) and resource files (JavaScript, CSS, and so forth) from a static web server such as Apache httpd. Here is an example of that:
GWT configuration: http://reluk.ca/y/vw/w/publicConfig/gwt.js
Note the call to a_web_gwt_App_setMirroredContextLocation
(this method).
Apache httpd configuration: http://reluk.ca/system/host/obsidian/etc/apache2/7_domain/reluk.ca/public/5_in_project_votorola.conf
Note that the Alias directives serve both the public configuration (~/votorola/web/publicConfig) and code (~/votorola/code/votorola/a/web/context) under request URLs that share a common basepath (/y/vw). Choose any basepath.
Alias /y/vw/w/publicConfig /home/v/votorola/web/publicConfig Alias /y/vw /home/v/votorola/code/votorola/a/web/context # -------------------- ----------------------------------------- # Formal request URL Actual directory served
You may wish to configure perfect caching.
See for example the various
Expires
directives under:
<Directory "/home/v/votorola/code/votorola/a/web/context">
Wicket configuration: http://reluk.ca/system/host/obsidian/home/v/votorola/web/vowicket.js
Note the call to wicCC.setMirroredContextLocation().
Result as served statically, for example: http://reluk.ca/y/vw/xf/
IllegalArgumentException
- if the location ends with a slash '/'
character.getMirroredContextLocation()
@GWTConfigCallback public static String getServletContextLocation()
@GWTConfigCallback public static void setServletContextLocation(String s)
a_web_gwt_App_setServletContextLocation( 'http://http://HOST-NAME:8080/VOTE-SERVER-NAME' ); // there is no dependable default, you should set a value
IllegalArgumentException
- if the location ends with a slash '/'
character.getServletContextLocation()
@GWTConfigCallback public static String getUsername()
IDPair.username()
,
setUsername(String)
@GWTConfigCallback public static void setUsername(String newUsername)
a_web_gwt_App_setUsername( 'Joe-GmailCom' ); // otherwise null
getUsername()
public JsonpRequestBuilder jsonp()
public JsonpRequestBuilder jsonpWAP()
WAP
public String staticContextLocation()
public void fireEvent(GwtEvent<?> e)
fireEvent
in interface HasHandlers