File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Validation problem with Struts1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validation problem with Struts1.2" Watch "Validation problem with Struts1.2" New topic

Validation problem with Struts1.2

sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130

The following validation is working with my old struts.jsr file. If I replace with Srruts1.2, validation fails any idea please.

<form name="/login">
<field property="userName" depends="required" >
<arg0 key="Heloo User Name please" resource="false"/>
<field property="password" depends="required" >
<arg0 key="Heloo Password please" resource="false"/>

Could some one explain how to validate a dropdown if defult value is "Select".(User must select other than "Select" from the dropdown)

Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
I am not sure if this is the best possible solution, but you can have the value as empty space for SELECT option. Now, having a validation rule as REQUIRED might trigger an alert message.

Hope this helps you.
sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130

I have this in validation.xml and value for the "Select" made as empty, then validation started working but not sure how

Is there any other way without taking out the value ?

<field property="selectbox" depends="requiredif">
<arg0 key="Heloo select dorpdown please" resource="false"/>
<var-value>((selectbox == null) or (*this* == "Select"))</var-value>

martin jose

Joined: Aug 10, 2005
Posts: 9
Hi Sudhakar,

My struts1.2 validation is working perfectly, but we don't have any plugin support for struts1.2 in eclipse. So I have to do the validation in struts1.1 itself. I am not getting any help for 1.1 validation. I am doing the same thing in both, but only 1.2 is working. In 1.1 it is simply ignoring the validation. Is there any difference in validation.xml entries. Please give me some tips.

Thanks in advance
I agree. Here's the link:
subject: Validation problem with Struts1.2
jQuery in Action, 3rd edition