File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes problem in field validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in field validation" Watch "problem in field validation" New topic
Author

problem in field validation

madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
hi,
in my application..i m using server side validation....the field is not getting validated...can any one help me out..here is the code...
ravindar dayachand
Greenhorn

Joined: May 08, 2009
Posts: 14
I think this is a validation on the client side.For this to work you need to declare the tag <html:javascript> in your jsp page

For serverside validation we have to define the validate method in my form class.

Please try this, it may work
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
hi,
here is my jsp code
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
any help regarding my post...i had declared error method in class..here is the code

Armin Vetek
Greenhorn

Joined: Aug 21, 2010
Posts: 29
Hi,

I thing that the field is validated but you do not see the validation because you use simple theme.

Change the simple theme to xhtml theme for the beginning regardless of layout.

You should add fielderror to simple theme if the validation will work.

Best regards,
Javanus


http://www.javanus.com/blogs
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
hi,
i had used theme="simple" in all my application..for upload it is working..but not for "manage" page ..changed the code..as follows
ravindar dayachand
Greenhorn

Joined: May 08, 2009
Posts: 14
Use

<html:javascript formName="your form name"/> before the beginning of your table tag

<s:form action="manage" namespace="/audiocontent" method="POST" theme="simple">
<html:javascript formName="your form name"/>
<table>
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
hi ravindar,
i got what you suggested...but i didnt used any javascript in my application..i used interceptors and here is my configuration file...
Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

I think when add/change the interceptor stack; the default interceptor stack will get removed.
Try adding after the <interceptor-ref name="uploadContent"> tag.


A.A.Anbarasu
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

hi madhuri.


Try putting required.....in place of requiredstring.

How are you showing your error in span.?

Good luck!!
A small leak can sink a Gigantic ship.>
Rajkumar Kathiresan
Greenhorn

Joined: Dec 30, 2008
Posts: 8
1. Your validation file name must be <actionclass>-<validation>.xml
2. your action should have getters and setters for the field against you are validating.
3. In interceptor basicStack must be above the validation & workflow interceptor in struts.xml.
4. <S:fielderror> is doesnot have a property "fieldName"
use like this
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in field validation
 
Similar Threads
Adding more than one validation to form field
Need help with Validation.xml
Annotation in Validation
Conditional validation in Struts2
Struts 2 Validation