Solve your servlet-based presentation problems; Various techniques for implementing content presentation in thin-client applications

I've contrasted the way raw servlets support dynamic pages -- by embedding HTML inside the Java code -- with the way the WebMacro and FreeMarker templating engines embed some form of scripting inside HTML files. XMLC's approach is completely different. (See Resources.) XMLC is a specialize...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Java world 2000-11, p.1
1. Verfasser: Unger, Kevin
Format: Magazinearticle
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:I've contrasted the way raw servlets support dynamic pages -- by embedding HTML inside the Java code -- with the way the WebMacro and FreeMarker templating engines embed some form of scripting inside HTML files. XMLC's approach is completely different. (See Resources.) XMLC is a specialized Java compiler for HTML (or XML) template files. That's right, XMLC compiles pure HTML files into Java class files, with a unique class for each unique HTML template. Prior to JSP 1.1 (released in early 2000), liberal use of Java code scriptlets in JSPs was a virtual necessity. JSP pages containing all this code can hardly be considered presentation "templates" -- they're actually presentation logic source code files. Version 1.1 introduced a powerful tag extension feature that lets you define custom tags and associate them with Java classes. With tag extensions, you can move the scriptlets to the tag handler classes. You can also use JSP as a templating engine by encouraging the development of rich sets of custom tags whose handlers contain all the Java code that would have otherwise been in the JSP page. While this doesn't eliminate the possibility of using lots of scriptlets in the page, it almost eliminates the necessity. Struts (see Resources), another subproject of the Jakarta project, is analogous to the Rocks framework, but Struts actually has code. Struts is an MVC implementation of a presentation framework that uses JSP pages as the views. The Struts framework includes an implementation of the controller servlet that maps requests to actions and JSP pages. (The actions drive the state of the model.) The other main part of the system is an extensive custom tag library. The tag library, in concert with the controller servlet and the framework's own classes and interfaces, comprise the most robust presentation solution described so far.
ISSN:1091-8906
1091-8906