On 9/9/05, emre akbas <[EMAIL PROTECTED]> wrote:
> Hi,
> I want to know what the state-of-the-art practices about Struts validation
> are.

Try these:
  https://strutslive.dev.java.net
  https://formdef.dev.java.net

> It is well-known that there are some problems in automatic validation.
> Here is a good article:
> http://www.reumann.net/struts/articles/request_lists.jsp Are the ideas in
> this article obsolete?

No more obsolete than Struts itself. Anyway, because I try to keep all
action-related stuff in the ActionForm, I never encountered the issue
of losing request-scoped objects. It seems a little strange to me,
that request-scoped objects are lost on forward, which happens on the
server.

> As far as I understand, the best practice is calling the validate() method
> manually. This requires that we write ... validate="false" ... in the
> action-mapping definition. However, if we do this, we cannot use javascript
> (client-size) validation. I want to use javascript validation. What are the
> possible solutions?

Struts cannot decide whether the tags should or should not generate
client-side validation javascript in the JSP pages belonging to an
action, simply because Struts does not have the notion of a JSP page
"belonging" to a certain action class. Actions and pages are
interlaced in a chain fashion and generally you don't know which
action the data from a page will be submitted to.

Therefore client-side validation is set separately with
<html:javascript> tag on JSP page, while automatic server-side
validation is set with validate="true" in the action mapping
definition.

Michael.

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

Reply via email to