Use the JAXFront ServletAdapter to dispatch all JAXFront relevant servlet requests within your own servlet. Alle requests are handled by "Your Servlet". You have also full control and access to the instanciated JAXFront DOMHandlers. The created JAXFront DOM's resist in the memory scope of your servlet.

To generate JAXFront web forms within your own servlet, copy the folders (_images, js, lic, style, templates, WEB-INF/lib) from the jaxfront.war into your webapp directory (e.q. myWebApp) where your servlet is located:

In your servlet you need to dispatch all JAXFront relevant servlet calls to the JAXFrontServletAdapter. Do this in the service() method or in your doGet/doPost() methods.
Method: service()

protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
//do your own stuff here...
if (JAXFrontServletAdapter.doesConcern(request)) {
JAXFrontServletAdapter.getInstance().handle(request,response);
}
//do your own stuff here...
}
Method: doGet(), doPost()

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException {
//do your own stuff here...
if (JAXFrontServletAdapter.doesConcern(request)) {
JAXFrontServletAdapter.getInstance().handle(request,response);
}
//do your own stuff here...
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException {
//do your own stuff here...
if (JAXFrontServletAdapter.doesConcern(request)) {
JAXFrontServletAdapter.getInstance().handle(request,response);
}
//do your own stuff here...
}


Your servlet is now responsible to create JAXFront web forms. This means that you have to create a JAXFront DOM first, visualize & serialize it as an XHTML stream. There are two ways creating a JAXFront web form:

  • Keine Stichwörter