That's a great question!
Check out this page for a comparison between GXP and other templating
systems, particularly JSP:
http://code.google.com/p/gxp/wiki/WhyGxp
By the way, GXP is not an alternative to Servlets, but instead
complements them. A typical web application might have its business
logic implemented in Servlets and then use GXPs for the presentation
layer.
We'll try and write some more documentation showing how one invokes a
GXP from a Servlet, but the basic idea is that you get the Writer from
your ServletResponse (using getWriter()), and then pass this to a
GXP's write() method as the first parameter. This might look something
like this:
/**
* A servlet for viewing the "stuff".
*/
public class ViewStuff extends HttpServlet {
...
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
// business logic goes here
// "StuffPage.gxp" has the presentation logic
StuffPage.write(
response.getWriter(),
new GxpContext(request.getLocale()),
/* parameters computed by business logic go here */);
}
}