File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in field validation

 
madhuri kunchala
Ranch Hand
Posts: 350
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 350
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
here is my jsp code
 
madhuri kunchala
Ranch Hand
Posts: 350
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any help regarding my post...i had declared error method in class..here is the code

 
Armin Vetek
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
madhuri kunchala
Ranch Hand
Posts: 350
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 350
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
Chrome Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think when add/change the interceptor stack; the default interceptor stack will get removed.
Try adding after the <interceptor-ref name="uploadContent"> tag.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi madhuri.


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

How are you showing your error in span.?
 
Rajkumar Kathiresan
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic