Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validation problem.

 
rajiv shrestha
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code of the related JSP page...
 
rajiv shrestha
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jsp page is given below

 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
can i have a look at struts.xml
 
rajiv shrestha
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
struts.xml is given below.

 
Ankit Garg
Sheriff
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no validate method is not called
Action class:
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is solved with this code..



instead of
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic