aspose file tools
The moose likes Struts and the fly likes Struts2 ActionSupport strange issue, without extending it, works fine. please explain the concept Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "Struts2 ActionSupport strange issue, without extending it, works fine. please explain the concept" Watch "Struts2 ActionSupport strange issue, without extending it, works fine. please explain the concept" New topic
Author

Struts2 ActionSupport strange issue, without extending it, works fine. please explain the concept

Nandish Sri
Ranch Hand

Joined: Jan 19, 2004
Posts: 45
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.

Please explain why it is happening like this ???

Struts action config:

Login.jsp:


Struts action class:


LoginInfo.java


Tiles:



Nandish
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 7796


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.


com.opensymphony.xwork2.Action


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
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.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 7796

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
Ah, gotcha.
Nandish Sri
Ranch Hand

Joined: Jan 19, 2004
Posts: 45
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
@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
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
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
 
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture