Meaningless Drivel is fun!
The moose likes Struts and the fly likes Struts 2 field validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 field validation" Watch "Struts 2 field validation" New topic

Struts 2 field validation

Ramkumar Subburaj
Ranch Hand

Joined: Sep 07, 2007
Posts: 83

I want to validate two password fields in change password m and I have the following in my validation.xml

and in my JSP page source, i get the following Java Script validation code

As youi can see, the Java script validation is not what I except. It is checking only if the field exists and not performing the comparison

Is there anything I am missing


SCJP 1.5, SCWCD 1.4.
Hanging between Web Services and EJB
David Newton

Joined: Sep 29, 2008
Posts: 12617

Ramkumar Subburaj wrote:Is there anything I am missing

Ramkumar Subburaj
Ranch Hand

Joined: Sep 07, 2007
Posts: 83
Thanks for the reply.

If I'm not wrong, "fieldexpression" can not be used for client side validation.

If that is the case, is there any way of achieving it or should we go for handwritten java script.
I agree. Here's the link:
subject: Struts 2 field validation
It's not a secret anymore!