Two Laptop Bag*
The moose likes Struts and the fly likes function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "function "validate()" does not execute" Watch "function "validate()" does not execute" New topic
Author

function "validate()" does not execute

Abhimanyus singh
Greenhorn

Joined: Apr 11, 2012
Posts: 27
Hey Guys::: PLease help me out....the function validate() is not executing, do not know why ???
Here are my files:::::::

LOGIN FORM


ACTION CLASS


STRUTS.XML FILE




and finally the,

MODEL CLASS




Control does not reach the execute function !!! and when I try to develop the same application without the model object "user", validation executes !!! Please help !!!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

"vaildate" <> "validate"


[How To Ask Questions On JavaRanch]
Gopakumar Naryanan
Ranch Hand

Joined: Jan 15, 2011
Posts: 72

Please check your User class.. is there any specific requirement that it should extend ActionSupport class?
I have not worked on Struts 2.. but i haven't seen anywhere one action class being instance variable of other..



Thanks & Regards
Gopakumar
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Gopakumar Naryanan wrote:Please check your User class.. is there any specific requirement that it should extend ActionSupport class?


It is not required that a java bean extend ActionSupport. As a matter of fact, Struts 2 doesn't require an action to extend ActionSupport, though ActionSupport implements many useful methods.
As I pointed out in my previous post, Gopakumar misspelled the method name in his action. Struts will not automatically call the validate method in the User bean
Gopakumar Naryanan
Ranch Hand

Joined: Jan 15, 2011
Posts: 72

Thanks.. i didn't notice the spelling mistake you specified.
 
 
subject: function "validate()" does not execute