• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, gotcha.
 
Nandish Sri
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@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
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to hear you figured it out--those validation files can cause problems if we forget about them!
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic