public interface ItsNatServletRequestListener
This interface is the ItsNat version of the Servlet.service(ServletRequest,ServletResponse)
version. When a client request is received the ItsNat servlet converts and routes this request
to the registered ItsNatServletRequestListener objects invoking
processRequest(ItsNatServletRequest,ItsNatServletResponse), usually
this request is a page load request. This method is not called for events.
A request listener is registered usually calling ItsNatDocumentTemplate.addItsNatServletRequestListener(ItsNatServletRequestListener)
and optionally calling ItsNatServlet.addItsNatServletRequestListener(ItsNatServletRequestListener)
(for uses like filtering etc).
Another different use is as ItsNat referrer request listener if registered
with ItsNatDocument.addReferrerItsNatServletRequestListener(ItsNatServletRequestListener).
In this case the listener is called when the framework loads
a new target document and the referrer document (the document where the listener
was registered) is being unloaded and before the target request listeners are executed
(referrer push). Request and response objects are the same objects being sent to the normal
target request listeners, target document may be modified, new request attributes may be added
etc before ItsNat delegates to the normal target loading process.
| Modifier and Type | Method and Description |
|---|---|
void |
processRequest(ItsNatServletRequest request,
ItsNatServletResponse response)
If this listener is registered this method is invoked when a client request is received
usually for loading a new page.
|
void processRequest(ItsNatServletRequest request, ItsNatServletResponse response)
If a new document was requested the ItsNatDocument object is already created using the required template,
this document may be obtained calling ItsNatServletRequest.getItsNatDocument()
or ItsNatServletResponse.getItsNatDocument(). In this scenario
there is no need to use the standard output stream ( ServletResponse.getWriter()
or ServletResponse.getOutputStream() ) because ItsNat already
uses it behind the scenes. Usual page load request processing involves DOM tree manipulation or custom JavaScript
is sent calling ItsNatDocument.addCodeToSend(Object)
or ClientDocument.addCodeToSend(Object).
If no new or existing document is requested the request processing
is mostly the same as the typical Servlet.service(ServletRequest,ServletResponse)
processing including output to standard output stream. This scenario
is an opportunity to change the normal ItsNat document request
for instance to implement pretty URLs, because the request may be
forwarded again to ItsNat calling
ItsNatServlet.processRequest(ServletRequest,ServletResponse).
request - the ItsNat request object.response - the ItsNat response object.Copyright © Innowhere Software, Jose Maria Arranz Santamaria.