• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validation problem with Struts1.2

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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>
<field property="password" depends="required" >
<arg0 key="Heloo Password please" resource="false"/>
</field>
</form>

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

Thanks
Sudhakar
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vijay,

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>
<var-name>test</var-name>
<var-value>((selectbox == null) or (*this* == "Select"))</var-value>
</var>
</field>

Thanks
Sudhakar
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Martin
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic