Writing Extensible Server Pages

In Chapter 41 you looked at Java Server Pages (JSPs). As you might have noticed, JSPs solve one problem while making another. They provide a nice mechanism for generating dynamic content but they force you to embed stylistic tags inside the source code, tightly coupling content and presentation.

Separating Content from Presentation

As you've seen in this chapter, XML provides an excellent way to separate content and presentation. Instead of writing JSPs, we can write Extensible Server Pages (XSPs) that read XML documents and generate HTML based on an XSL style sheet. Like JSPs, XSPs can contain Java code that is compiled when the document is first loaded.

Note

You can read more about XSP on Apache's Cocoon site ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.