Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2007, 03:39 AM
Registered User
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default strut validation frame work issue

I am using strut validation frame work.



I have four input field's for all input field's it shows four massage's of validation if they are empty but I want only one massage if all the fields are empty and if any one is field then the common massage.
:)
Like when any one field is empty then it will show the massage for those fields’s only.

Is it possible in strut to show single massage if all the fields are empty. (ex: All * field are required)



I am new to strut.

I try to use validwhen and dependantFields but this doesn’t work it out.

Is there any other way to do it?


 
Old June 7th, 2007, 11:40 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

You can use a boolean variable in the validate method of your form bean and check whether the mandatory fields were left empty whenever you find an empty mandatory field make the boolean variable true and at the end check the boolean varible, if it is true add an error message which says all mandatory fields need to be filled. You can also use a count variable to count the no.of mandatory fields left empty and check that value if its greated than one then give a common message.

Regards,
Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Use EXE file without .NET Frame Work Saudan C# 1 August 9th, 2008 05:35 AM
Regarding SSRS Frame Work mike.chary Reporting Services 0 August 17th, 2007 09:35 AM
Avoid .net frame work installation with setup inst kalyanRavula .NET Framework 2.0 4 May 4th, 2007 06:45 AM
IE 6.028 Frame with Pop-Up Issue rlarose Javascript How-To 0 December 2nd, 2004 12:50 PM
about .net frame work Ramakrishna.G General .NET 8 September 27th, 2004 04:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.