Project

General

Profile

Web Interface

Web UI Stack

The web-interface is provided by a integrated web-server. Below is a description of the stack:

  • Web-server: Jetty
  • Page generator: internal classes at source:trunk/src/net/lukemurphey/nsia/web/views
  • Templating engine: Freemarker

How the Web-Interface is Generated

  1. Jetty web-server receives request
  2. Jetty executes the relevant servlet
    • GraphServlet provides charts and graphs (see source:/trunk/src/net/lukemurphey/nsia/web/GraphServlet.java)
    • MediaServlet provides images, stylesheets, and other static content (see source:/trunk/src/net/lukemurphey/nsia/web/MediaServlet.java)
    • WebConsoleServlet provides the web-page structure (see source:/trunk/src/net/lukemurphey/nsia/web/WebConsoleServlet.java)
  3. WebConsoleServlet processes the middleware which provides the login banner, checks for authentication, etc. (see source:/trunk/src/net/lukemurphey/nsia/web/middleware)
  4. WebConsoleServlet executes the views associated with the URL. The views are listed in the StandardViewList class (see source:/trunk/src/net/lukemurphey/nsia/web/StandardViewList.java).
  5. View provides the web-page content and returns true. Otherwise, the WebConsoleServlet provides an error message indicating that now view accepted the URL (and posts an HTTP code 404).

Relevant Classes

The web-interface is generated by a series of classes that sub-class source:/trunk/src/net/lukemurphey/nsia/web/View.java. The classes that are used to render the web-interface are available under source:trunk/src/net/lukemurphey/nsia/web/views and must be registered with the StandardViewList class. The web pages are rendered using freemarker templates. The templates are available under source:trunk/src/net/lukemurphey/nsia/web/templates.

Below are links to the namespaces and classes involved with generating the web-interface:

  • Standard view list: source:/trunk/src/net/lukemurphey/nsia/web/StandardViewList.java
  • Namespace that contains the view classes: source:/trunk/src/net/lukemurphey/nsia/web/views
  • Namespace that contains the templates: source:trunk/src/net/lukemurphey/nsia/web/templates
  • Standard middleware list: source:/trunk/src/net/lukemurphey/nsia/web/StandardMiddlewareList.java