Andrew Cockburn wrote:

> Dear All,
>
> I am currently looking hard at the STRUTS package, and hoping it will solve
> some design problems that I have. I am happy with the MVC scheme of things
> and have been wrinting an application to that pattern part time and latterly
> full time for the last 18 months. It has been MVC from the outset, although
> a bit shaky at the start as I was learning JAVA, Servlets and JSP pretty
> much as I went along. My back ground is in middleware (old style TP Monitors
> such as Encina, Tuxedo and TopEnd) so I understand the principles of
> separation of Display and Business logic. After a post to the Jakarta
> mailing list, Craig McClanahan pointed me in the direction of STRUTS, and it
> does indeed seem to address some of the shortcomings of JSP - i.e. keeping
> JAVA out of JSPs which I have found to be a necessary evil. Before I leap
> wholeheartedly into STRUTS I have a couple of questions that the docs don't
> seem to address (or I haven't spent enough time reading them) :
>
> 1. The docs seem to state that STRUTS is intended to be used with Server
> Side validation. Whilst this is on occasion necessary, my design approach
> has been to avoid this wherever possible. Typically, I will use a
> Servlet/JSP combination to fill an initial form, providing choices rather
> than free-text wherever possible, and then use JavaScript to validate fields
> wherever possible. In my entire application I have only found it necessary
> to validate server side once, and that was for security reasons. This is
> probably because my business logic is not too complex and I am mainly
> interested in capturing simple defined data. The up side of this is that the
> application becomes very point and click and (I hope) easier for the end
> users. What I am asking is, will STRUTS gracefully support a 2 stage
> approach to forms - 1 stage to construct and fill in values, and a second
> one to gather responses and process ?
>

At some point (i.e. as soon as someone has time to write it and contribute it),
I would like to see Struts have support for optionally generating client-side
JavaScript validation functions.  This is unlikely to be possible in time for
1.0, but seems feasible for 1.1.  In the mean time, nothing stops you from doing
client side JavaScript on your own, just as you would in a stand alone JSP or
HTML page.

However, I personally will never write a webapp without full server side
validation in addition to whatever client side validation is performed.  It is
too easy to have clients who have turned off JavaScript, or malicious folks who
write an application that simulates a browser's interaction with the server, and
therefore bypasses all of your nice edits.

>
> 2. When creating forms, the documentation talks about "Rendering" buttons
> etc. - this set me thinking - Is there a large degree of XML in STRUTS ?
> e.g. can you swap a stylesheet and render in WML instead of HTML ? This is
> also something I am looking to achieve as a long term design goal - if not
> now, does STRUTS intend to support this kind of thing in the future ?
>

The Struts form tags are very much HTML oriented, because they only know how to
generate HTML-style forms.

One of the major focuses of 1.1 will be better integration with XML in many
directions, including an investigation of using things like XPath, XForms, and
so on.

For integrating XSLT transformations, I would suggest utilizing the "xsl" tag
library in the Jakarta Taglibs project <http://jakarta.apache.org/taglibs>.  The
<xsl:apply> tag is very powerful and flexible, and can interoperate with Struts
cleanly.

>
> Excuse my long windedness, and thanks in advance for any enlightenment,
>
> Regards,
>
> Andrew

Craig


Reply via email to