File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Struts Tags VS. XML/XSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Struts Tags VS. XML/XSL" Watch "Struts Tags VS. XML/XSL" New topic

Struts Tags VS. XML/XSL

Ted Bell
Ranch Hand

Joined: Jan 21, 2002
Posts: 52
Hi all,
Working on a design for a web application here and there is some debate on method of presentation.
We use Struts quite a bit here, and have been relatively pleased with it. Some of the guys on the new project are suggesting using struts for validation and tiles framework, but to generate the main body content of the pages using XML/XSL. To me this makes little sense:
If I am creating struts form beans for validation anyway, why not use the simple tags provided by struts in the resulting JSP? I like the way all the form fields are populated for me.
We are given HTML templates from our art department, which we then use to create JSP content. I have found it a total pain to try and format/edit a large/complex HTML page to make it XSL-friendly. To me, taking the page and replacing html form fields with struts html tags is much faster.
Now instead of letting struts create form beans from request parameters and populate a JSp for me, I have to somehow get those parameters into an XML tree so the stylesheet can find them.
We may have a need to define a custom tag or two, and some folks have commented that that will create work to maintain those supportin tag classes. But the logic included in a tag class which brands content based on the user will have to be written anyway, and may not be centralized in a single class.
I realize that struts is not perfect, and it's not practical for very simple web apps, but we know how to use it, and I don't see that we have time to write our own framework or learn a brand new one.
Hoping the good folks here can share some of their insight on this.
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
... just waiting to see if somebody scolds "Art" for not using a real name ...

Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
I agree. Here's the link:
subject: Struts Tags VS. XML/XSL
It's not a secret anymore!