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 validation problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation problem." Watch "validation problem." New topic
Author

validation problem.

rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30
i have action class with following code


my problem is validate() method not working.
it only give actionerrors i.e. "Invalid User Name or Password"; eventhough if i provide empty string in the text box for username and pwd.
need some assists.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Can you post the code of the related JSP page...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30
Jsp page is given below

Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

Hi.
can i have a look at struts.xml


Good luck!!
A small leak can sink a Gigantic ship.>
rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30
struts.xml is given below.

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Is the validate method being called?? Check if your action implements Validateable interface (the struts configuration is not of much use as we don't know the name of your action class)...
rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30
no validate method is not called
Action class:
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

hi rajiv..
Define result type 'input' in your struts.xml.

I think that will help..
Struts is redirecting your control to result type 'input'

please mention it inyour struts.xml

Thanks n Regards
Raza
rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30
the problem is solved with this code..



instead of
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validation problem.