If this listener is registered this method is invoked when a client request is received usually for loading a new page.
If a new document was requested the {@link org.itsnat.core.ItsNatDocument} object is already created using the required template,this document may be obtained calling {@link org.itsnat.core.ItsNatServletRequest#getItsNatDocument()}or {@link org.itsnat.core.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 {@link org.itsnat.core.ItsNatDocument#addCodeToSend(Object)}or {@link org.itsnat.core.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 {@link org.itsnat.core.ItsNatServlet#processRequest(ServletRequest,ServletResponse)}.
@param request the ItsNat request object.
@param response the ItsNat response object.