Hello,

I read that article too since I'm trying to use xslt with struts.

I thought it was a great article, but I didn't agree with their
approach.  (I sent an email to the author about it and received no
answer so far.)  BTW, I'm by no means a struts, xsl or java guru.  I'm
just stating my opinion here, and I welcome any corrections or
suggestions.

So here it goes.

The problem with their approach IMHO is that to create a true MVC
environment (which is good), the approach is creating too much overhead
(i.e generating XML on the fly and parsing it to feed the XSL, all at
the runtime).  Also one of the reason people like me love struts is
because of the extensive tag-libs which allow you to eliminate business
logic entirely from your jsp files. But what that article suggested was
not using struts tags and jsps at all.  

So my approach of incorporating XSLT to struts is as follows: (this is
only in conceptual level yet. Trying to get it to work in the near
future though)

- Create a form definition in XML (or use struts-config to define the
form properties but I'd hate to touch the struts-config for business
logic related stuff).
- Create a XSL for the form
- using the form definition and DynaActionForm, populate the instances
of form beans.  Or I am also considering pre-generating form beans based
on the xml form definition (or use struts-config to define the form
properties)
- Action class doesn't have to know the details of the form bean.  It's
just going to pass the form beans to manager classes that handles
database, etc. Using the form definition file, I could gererate prepared
statements or something like that too.
- At the deployment time, I would also like to pre-generate jsps out of
XML/XSL using xslt such as xalan instead of doing the transformation at
the runtime.  From my brief testing, xalan seems to cache the generated
templates, but still pre-generating the files would work better.

The problem I need to solve is figuring out how to put struts tags in
the XSL.  The only way I could think of so far is put xsl namespace
definition for struts in the XSL file (ie xslns:html) and replace the
line with struts tag definition during pre-generation of the jsp files.

Any thoughts would be appreciated.


-----Original Message-----
From: maya menon [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 07, 2003 12:29 PM
To: Struts Users Mailing List
Subject: RE: XSLT Struts



The artcile is the same one from Javaworld that you sent me, I already
downloaded the example, but it explains nothing. the article is good,
but the sample is vague
Thanks
 [EMAIL PROTECTED] wrote:here we go
http://www.javaworld.com/javaworld/jw-02-2002/strutsxslt/jw-0201-strutsx
slt.
zip
http://www.oroad.com/opencode/stxx/download.html

these are two custom approachs (both with java sources), but if I can
tell
my feeling on the question, I suggest -if your app is "large"- that you
feed
cocoon with you're serialized XML ... but I don't own such an example.

By the way, could you please send me your wonderful article ?

thank's & regards,
fabrice.

-----Original Message-----
From: maya menon [mailto:[EMAIL PROTECTED]]
Sent: mardi 7 janvier 2003 18:05
To: Struts Users Mailing List
Subject: RE: XSLT Struts



Fabrice
I got a wonderful arcticle,
But I need a good example..
do u have any or any suggestions\

[EMAIL PROTECTED] wrote:Hi,

go to javaworld.com and search for "XSLT struts" you'll find good
articles +
links to sources...

regards,
fabrice.

-----Original Message-----
From: maya menon [mailto:[EMAIL PROTECTED]]
Sent: mardi 7 janvier 2003 17:32
To: [EMAIL PROTECTED]
Subject: XSLT Struts


Hi, 
Can any body pls give me an example of using XSLT and struts.. Or can
any one tell me how to convert the sample Struts application so that it
uses Model 2 architecture rather than the usual JSP routines .... Any
help apprecaied.
I have had experience with both as seperate techs, but havent used both
together.. 
I was going thru an article from Javaworld, and was thinking of how to
make the sample struts application in such a way that it doesnt have any
JSPs..

Any links, appreciated 
Thanks 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to