What is StruXSLT?

The basic idea was taken from an article published at www.javaworld.com. When using XML/XSLT instead of jsp, separation between view and the other layers of MVC-model is more strict.



StruXSLT is an extension for jakarta Struts, which should enable the usage of XSLT for the view-part of struts instead of jsp without changing or limiting the functionallity of struts. To use this package, a new base class has to be used instead of Struts' Action-class, but it is not necessary to exchange the ActionServlet (so registering struts within web.xml can be as is customary for Struts).

StruXSLT sits on top of Struts, extending its existing functionality to allow Action classes to return XML that will be transformed by technologies like XSL and XSL-FO. One motiviation to use q-struxsl is to remove the need to use JSP and tag libraries for the presentation layer of the Struts framework. However, q-struxsl does not force you to go the XML route, both technologies will work side by side.

The basic features of this framework are listed here:

Action Classes

StruXSLT strictly separates between view-actions and process-actions, so two main base classes exist within the framework. This diagram should just give an overview of the methods to be overriden from the perspective of the user of the framework.



BaseStruXSLAction

This class serves as the base class for all action classes within the whole framework. Here, also an instance of the Session Manager is held, where basic settings for user session are stored. In general, messages, errors and other informations can be set from any action. All this information is transformed to XML and offered to the view-layer. So basic managing (like adding errors an messages) of all theses messages is implemented here.

BaseStruXSLViewAction

Use this class as base class for all Actions generating (XML-) data. All information specific for a certain action is generated within the generateXML, so implement this abstract method in the project-specific view-class when overriding BaseStruXSLViewAction.

BaseStruXSLProcessAction

This is the base class for all actions which should process any data (which in general means writing information to the database or to the session). The abstract method doProcessData has to be overriden within the concrete subclass. As return value, an ActionForward constant is returned.

Mapper

XSLT-map

the central configuration file for the whole framework is xslt-map.xml, where the XML-generating action is weaved together with the stylesheet and language token documents to ensure language independence. Internally, one XML-document ist generated, which is rendered by the XSLT-document specified. A simple entry can be defined as shown in the following example:
	<entry path="/basicsettingsv" type="simple" lang_file="admin/basicsettings.xml">
		<xslt path="admin/basicsettings.xsl" />
	</entry>


....to be continued :)