Struts2 ActionSupport strange issue, without extending it, works fine. please explain the concept
Nandish Sri
Ranch Hand
Joined: Jan 19, 2004
Posts: 45
posted
0
After clicking Submit in Login.jsp page, Action is not calling IFFFF I extends ActionSupport.
If I remove the extends ActionSupport, it is working fine, it is calling execute method.
All actions may implement this interface, which exposes the execute() method.
However, as of XWork 1.1, this is not required and is only here to assist users. You are free to create POJOs that honor the same contract defined by this interface without actually implementing the interface.
David Newton wrote:I'm not sure how the Action documentation is relevant.
In any case, I'd guess it's a validation issue, but you don't provide enough information to help.
I'm confused. I thought it was basically the same question as this post. i.e. "why does it work if I don't extend ActionSupport?". I see now he's saying it doesn't work if he DOES extend ActionSupport.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Ah, gotcha.
Nandish Sri
Ranch Hand
Joined: Jan 19, 2004
Posts: 45
posted
0
I do not have any validation code in my jsp/action class. Please let me know what information I need to provide.
I am very much confused. I tried by putting @Override after extending ActionSupport on execute method. No results
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
@Override is a development tool to make sure you've actually overridden a method--nothing more.
Do you have validation XML config for the action? Have you set logging to DEBUG level to see if it's going through the validation stack (or if something else funky is happening)? Are you using the default interceptor stack?
I'd still guess it's a validation issue.
Nandish Sri
Ranch Hand
Joined: Jan 19, 2004
Posts: 45
posted
0
Yes David, your guess is correct Actually there was a Login-validation.xml file which I created long back. I forgot about that. Just now only I saw as per your comments.
This solved my problem Thanks a lot David
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Glad to hear you figured it out--those validation files can cause problems if we forget about them!
subject: Struts2 ActionSupport strange issue, without extending it, works fine. please explain the concept