|
|
IBIS-PH View System Requests
This page provides a description of how an HTTP request is processed by
the application. There are two types of requests; 1) static content - requests
for files that exist and are served up by the application server, and 2)
dymaically generated content - requests that are mapped to and handled by
Java servlets. This page focuses on dynamic content requests and details
the specific steps that a request follows to deliver a response to the user.
In general, dynamic content requests go through these steps:
- User makes a request (via a browser) to an application server/application
- Application server determines the application (via context mapping)
- Request goes through a filter chain (according to the filter request mapping)
- Request then is handed to the servlet (according to the servlet request mapping)
- Servlet looks up the appropriate controller object
- Servlet calls the controller object's "handleRequest" method
- Controller determines the appropriate XML data model and XSLT view
object then creates and returns a ModelAndView object
- Servlet then calls the returned ModelAndView object to get the view
- Servlet then calls the View object's "render" method with the model
passed as an argument
- View's render method does the XSLT/XML transformation and returns the response
- Filter/response wrapping is then given control as the response
bubbles back up through the filter chain (FILO)
- Response is streamed back to the user/browser that made the request
The next section provides a general discussion of a Java Application Server's
HTTP request URL. This discussion is provided to understand how the IBIS
application sees and handles requests. A general description of each type
of step in the request/response flow is then provided (General IBIS Request
Flow Overview). Following the flow overview is a series of tables which
provide details of each major type of IBIS-PH View System request. These
details include the Request Mapping, Filters applied, Spring Bean
Configurations, Java IBIS Controller used, the Model, and the View.
URL Request Anatomy
This section briefly discusses URL requests. There are two types of HTTP
requests; "get" and "put". Since most of the requests that the application
deals with are "get" type requests, that is what will be discussed in this
section (although "put" are similar). Get request URLs consist of six
segments; protocol, server address, application IP port, application
context, the resource with any path prefix information, and the parameter
name value pair(s). In general "get" request URLs are of the form:
protocol://address:port/application_context/resource
?parameter_1_name=parameter_1_value
¶meter_2_name=parameter_2_value
. . .
¶meter_N_name=parameter_N_value
A general request example of this form looks like:
http://ibis.health.utah.gov:8080/ibisph-view/query/result
?GraphicType=jpeg&GraphicName=StackedArea
An IBIS-PH View System "get" HTTP request example looks like:
http://ibis.health.utah.gov/home/welcome.html
Request URL Segments
| protocol |
http:// - most browsers automatically add this as
a prefix if omitted
|
| address |
IP address or DNS name of the web/application server (ibis.health.utah.gov) |
| port |
Optional IP port that the appilcation listens on.
The default value is 80. For Utah, no port is specified so it
defaults to "80". In the general example above this value is
"8080".
|
| context |
Application's address within that application
server. For Utah, the View system is the default application
and does NOT have a context identifier. In the general
example above, the context is "ibisph-view".
|
| resource |
Application's resource with any path information
that is needed to identify the requested item. In the IBIS
example it is "home/welcome.html". In the general example it
is "query/result".
|
| parameters |
Parameter name value pairs provide a special mechanism
to send additional information that an application server can
parse and use to create a unique, dynamically generated response.
Sometimes these parameter strings are called "parameter query
strings" or "URL request query parameters" etc.
|
The first three segements of a request are very general and simply define
an address. The last three segements are all dependent on the application
that is listening on that IP port and how it is programmed. In the IBIS
enviroment the listening application is a Java application server which
hosts a web application typically known as "ibisph-view". The Java application
server then hands over control to the IBIS-PH View System application which
then determines what to do to handle the given requested resource (and any
optional parameters).
General IBIS Request Flow Overview
Listed below is a general, ordered list of the steps that are taken for
any request being processed by the application.
- User makes a request
-
Request hits Java app server via "http://server_address_or_dns_name:IP_port".
The Java app server determines the application by using an application
context map. In the Tomcat Java app server it has a configuration
file (config/server.xml) that contains among other settings, an
application context to the application's deployment directory.
-
The web application (based on the context) is then handed the request.
The application control first checks for servlet filters and wraps
the request and response as applicable. Servlet filters are controlled
with URL mappings. These mappings and filter control properties
are specified in the application's "web.xml" file (located within
the application's "WEB-INF" directory. See the
filters page for more
information about the IBIS-PH View System's Filters. The order the
filters are listed corrsponds 1:1 with the order which the filters
are applied in the filter chain.
-
The application's Java servlets are then called. Again specified
and controlled with URL mappings like the filters in the "web.xml"
file. The IBIS-PH View System uses only one servlet - the Spring
Framework's Web MVC RequestDispatcher servlet. This servlet is
not part of the IBIS Java code. It exists as part of the Spring
Web MVC Framework.
-
The servlet init parameter named "contextConfigLocation" controls
the RequestDispatcher's main configuration properties. This property
contains "/WEB-INF/config/beans/dispatcher_servlet.xml". This property
file specifies a special Spring MVC Web bean object named
"SimpleUrlHandlerMapping". This bean configuration also contains
a list mapping of URL to controllers.
-
The Spring Web MVC Framework is centered around the Spring Controller,
the Spring Model, and the Spring View interfaces/objects. The
RequestDispatcher uses this SimpleUrlHandlerMapping object to look
up which controller should handle which request based again on the
URL. The controllers can either handle the response or return
a Spring Model and View object which are then used by the servlet
to return a response to the requestor. The IBIS controllers
typically contain some logic/business rules to determine which XML
document/data file to be used (model). The view object to use is
typically the transformation engine with the XSLT being specified
by as a property of the view.
-
The RequestDispatcher servlet uses the Model and View object returned
by the controller call to create the response to the user's request.
property: model xml path: xml/home/page
: then rest of the filename stripped from end request url. html
is replaced with xml.
: property passed in with an XSLT property set to xslt/home/page.xslt
Main IBIS Request Flows
| HOME PAGE REQUESTS |
| Request Mapping |
/home/*.html |
| Filters |
artifact, compress |
| Bean Configurations |
WEB-INF/config/spring/home.xml |
| Controller |
XMLSystemIDFromEndOfPathInfo - simple controller that pulls
the XML filename from the request resource path and filename.
The actual XML filename depends on the XML path property.
|
| Model |
XML: xml/home/page/*.xml
|
| View |
XSLTXMLTransformation
XSLT: xslt/home/page.xslt
|
| Indicator Profile View Request |
| Request Mapping |
/indicator/profile/view/*.html |
| Filters |
SVG graphic type and path adjustment, artifact, compress |
| Bean Configurations |
WEB-INF/config/spring/indicator.xml |
| Controller |
XMLSystemIDFromEndOfPathInfo - simple controller that pulls
the XML filename from the request resource path and filename.
The actual XML filename is dependent on the XML path property.
|
Model |
XML: xml/indicator/profile/*.xml
|
| View |
XSLT: xslt/indicator/profile/view.xslt
|
| Indicator Profile Chart Request |
| Request Mapping |
/indicator/profile/chart/*.jpeg |
| Filters |
SVG graphic type and path adjustment, artifact, compress |
| Bean Configurations |
WEB-INF/config/spring/indicator.xml |
| Controller |
XMLSystemIDFromEndOfPathInfo - simple controller that pulls
the XML filename from the request resource path and filename.
The actual XML filename is dependent on the XML path property.
|
Model |
XML: xml/indicator/profile/*.xml
|
| View |
XSLT: xslt/indicator/profile/view.xslt
|
| Indicator Profile Related Indicators Request |
| Request Mapping |
/indicator/related/*/*.html |
| Filters |
artifact, compress |
| Bean Configurations |
WEB-INF/config/spring/indicator.xml |
| Controller |
RelatedIndicators |
Model |
XML: xml/indicator/profile/*.xml
|
| View |
XSLT: xslt/indicator/profile/related_indicators.xslt
|
| Query Module Selection Request |
| Request Mapping |
/query/module_selection/**/*.html |
| Filters |
artifact, compress |
| Bean Configurations |
WEB-INF/config/spring/query.xml |
| Controller |
XMLSystemIDFromPathInfo |
Model |
XML: xml/.xml
|
| View |
XSLT: xslt/query/module_selection/selection.xslt
|
| Query Module Request |
| Request Mapping |
/query/module/**/*.html |
| Filters |
compress |
| Bean Configurations |
WEB-INF/config/spring/query.xml |
| Controller |
Module |
Model |
XML: xml/query/module/*/*.xml
|
| View |
XSLT: xslt/query/module/module.xslt
|
| Query Submit Request |
| Request Mapping |
/query/module/**/confirmation.html |
| Filters |
compress |
| Bean Configurations |
WEB-INF/config/spring/query.xml |
| Controller |
SubmitModule |
Model |
XML: Module XML with selected parameters.
|
| View |
XSLT: xslt/query/result/confirmation.xslt
|
| Query Result Request |
| Request Mapping |
/query/module/**/result.html |
| Filters |
SVG graphic type and path adjustment, compress |
| Bean Configurations |
WEB-INF/config/spring/query.xml |
| Controller |
Result |
Model |
XML: Module XML document along with IBIS-Q XML result.
|
| View |
XSLT: xslt/query/result/result.xslt
|
| Query Result Chart Request |
| Request Mapping |
/indicator/profile/chart/*.jpeg |
| Filters |
SVG graphic type and path adjustment, artifact, compress |
| Bean Configurations |
WEB-INF/config/spring/indicator.xml |
| Controller |
XMLSystemIDFromEndOfPathInfo - simple controller that pulls
the XML filename from the request resource path and filename.
The actual XML filename is dependent on the XML path property.
|
Model |
XML: xml/indicator/profile/*.xml
|
| View |
XSLT: xslt/indicator/profile/view.xslt
|
| Query Result Map Request |
| Request Mapping |
/indicator/profile/chart/*.jpeg |
| Filters |
SVG graphic type and path adjustment, artifact, compress |
| Bean Configurations |
WEB-INF/config/spring/indicator.xml |
| Controller |
XMLSystemIDFromEndOfPathInfo - simple controller that pulls
the XML filename from the request resource path and filename.
The actual XML filename is dependent on the XML path property.
|
Model |
XML: xml/indicator/profile/*.xml
|
| View |
XSLT: xslt/indicator/profile/view.xslt
|
| Query Drill Down Request |
| Request Mapping |
/query/module/**/drill_down.html |
| Filters |
compress |
| Bean Configurations |
WEB-INF/config/spring/query.xml |
| Controller |
ResultDrillDown |
Model |
XML: Module XML document with additional parameters.
|
| View |
XSLT: xslt/query/result/confirmation.xslt
|
| Admin System Publish Indicator Profile Request |
| Request Mapping |
/publish/indicator/*.xml |
| Filters |
security |
| Bean Configurations |
WEB-INF/config/spring/indicator.xml |
| Controller |
|
Model |
NA |
| View |
NA |
| Saving User Survey to Admin System Request |
| Request Mapping |
/home/SaveSurveyResponse |
| Filters |
None |
| Bean Configurations |
WEB-INF/config/spring/home.xml |
| Controller |
SaveResponse |
Model |
XML: xml/home/page/survey_confirmation.xml
|
| View |
XSLT: xslt/home/page.xslt
|
|