We're at the end of the process of writing a pretty large app using Struts with
XSL instead of JSP.  Like you, most of our data was represented as XML
internally.  However, if I was doing it again, I'd probably use JSP.

Here's what we've done.
We get XML data from the backend.  For each request we keep an object at request
scope that represents our "messages".  We merge the backend data with literals,
web app data, etc. into that message.  We have one JSP that invokes Xalan to do
the transform.  To accomplish this approach we extended Struts 0.5 a bit to
force it to pre-process and post-process the message on each request.

This approach works, but it's rather "kludgey".  We had to open up our backend
to XML, but in hindsight, we should have made our app J2EE-centric instead of
XML-centric.  XML would have worked much better as an adapter layer, and Struts
would work much better with JSP.  Much painful work that performs poorly would
have been avoided.

But that's not to say that it can't be done well.

-----Original Message-----
From: [EMAIL PROTECTED] 
Sent: Monday, May 07, 2001 7:20 PM
To: [EMAIL PROTECTED]
Subject: XSL instead of JSP


Has there been a discussion on using XSL/XML for the
view portion of Struts?  If not, does anyone have any
ideas on how to proceed.  I need to add this
functionality.  This development will gladly be
submitted to Apache.

Some vague ideas on how to use XSL:
-add a <view-mappings> section to struts-config.xml
-add a package org.apache.struts.view
-add ViewServlet, View, etc
-Xalan support

A few reasons to use XSL:
-Most of my application data is already stored in XML.
-I have more experience with XSL than JSP.
-XSL gives less power to the GUI designer. :)


thanks
Paul Flynn


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to