PageServlet?
did you scroll down the page ? or just see the first result and come here anyway searching: pageservlet+web
Intelligent Web Site Page Generation
Updated Mar 19, 2007 Introduction
Static web sites are a collection of HTML files. Dynamic sites like Amazon.com, on the other hand, require that you generate pages on the fly. This essentially means that your site becomes an application instead of a bunch of text files. Your web server must now map a URL to a snippet of executable code that spits out HTML rather than mapping to a file.
In the Java world, you have 2 main choices for executing server-side-Java:
- Servlets: HTTP protocol requests are routed to doGet() and doPost() methods in an HttpServlet subclass. Your code has embedded HTML.
- JSP: An HTML file with embedded, unrestricted Java code. Implemented as the doGet() method of an auto-generated Servlet.
JSP files are enticing at first as they are easier to use than servlets, but they encourage all sorts of bad habits are hard to deal with for large sites.
The best approach is servlets + a template engine. A template engine is usually an MVC (model-view-controller) based scheme where a template (the view) has "holes" it that you can stick values, computed by your business logic (the model). The "holes" are typically restricted to just attribute references or simple computations/loops to avoid re-inventing JSP. The web server + page code executed for a URL embody the controller. There are a million of these engines such as Velocity, FreeMarker, StringTemplate, Tea, …
To understand why the servlet + template engine approach is superior, it helps to look at the path all developers seem to follow on their way to template engines.
full article >
http://www.cs.usfca.edu/~parrt/course/601/lectures/page.generation.html