When the taakServlet receives an HTTP request,
it looks up the XHTML document; in this case it does not exist. Next the
servlet examines the source for business logic and in this case a taakScript
is defined. The Java class will perform business logic and return a view
back to the user. This requirement can be fulfilled in a variety of ways
ranging from:
An example of a taak-config.xml file
is shown below:
<taak-config>
<class-prefix>com.nevik.client.view</class-prefix>
<mapping path="/hello.htm"
class="HelloView.taak"
/>
</taak-config>
When the taakServlet receives an HTTP request,
it looks up the XHTML document and the document is parsed into a JDOM
object. The Taak script is instantiated and provided the TaakContext made
up with the JDOM object, servlet request, and servlet response. The script
is parsed and executed in the context. When executed, the script populates
the document with data from the middle tier. Once populated, the document
is outputted as XHTML and any URL rewriting is performed.
An example of a taak-config.xml file
is shown below:
<taak-config>
<class-prefix>com.nevik.client.view</class-prefix>
<mapping path="/hello.htm"
script="HelloView.taak"
/>
</taak-config>
When the taakServlet receives an HTTP request,
it looks up the XHTML document and the document is parsed into a JDOM
object. The Java Class is instantiated and provided the taakContext
made up with the JDOM object, servlet request, and servlet response. The
script is parsed and executed in the context. When executed, the class
populates the document with data from the middle tier. Once populated
the document is outputted as XHTML and any URL rewriting is performed.
An example of a taak-config.xml file
is shown below:
<taak-config>
<class-prefix>com.nevik.client.view</class-prefix>
<mapping path="/hello.htm"
class="HelloView.taak"
/>
</taak-config>
When the taakServlet receives an HTTP request,
it looks up the XHTML document and the document is parsed into a JDOM
object. Since no taakScript or Java class exist,
nothing further is happens except JDOM object is returned to XHTML and
any URL rewriting is performed.
An example of a taak-config.xml file
is shown below:
<taak-config>
<class-prefix>com.nevik.client.view</class-prefix>
<mapping path="/FAQ.htm"
/>
</taak-config>
If a taakScript is specified, the taakServlet
sets up the taakContext for the script. The
taakContext includes the ServletRequest defined
as the variable SERVLET_REQUEST, the ServletResponse defined as the variable
SERVLET_RESPONSE, the JDOM object defined as the variable DOCUMENT. The
script is then executed in the defined context. When the script is finished
executing, its exit condition is examined. The exit condition tells the
Servlet whether the script has an error, or the script is forwarding the
request to another URL, or the script is redirecting the request to another
URL, or the script completes successfully. In the last case, the JDOM
object that has been modified by the script is returned to the browser
after any needed URL rewriting is done.
When the taakServlet receives an HTTP request,
it looks up the XHTML document; in this case it does not exist. Next the
servlet examines the source for a handler and in this case a Java class
is defined. The Java class will perform business logic and returns a view
back to the user. This requirement can be fulfilled in a variety of ways
ranging from:
- Redirecting to another web site
- Redirecting to the taakServlet with a new
Request URL
- Forwarding to another web site
- Forwarding to the taakServlet with a new
Request URL
- Building a view and returning to back to the user
An example of a taak-config.xml file
is shown below:
<taak-config>
<class-prefix>com.nevik.client.view</class-prefix>
<mapping path="/hello.htm"
class="HelloView"
/>
</taak-config> |