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

Communication between Actions classes

 
Navi Lock
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks, need some guidance on the below..

Have 2 action classes. Ex: Action1.java and Action2.java.

Action 2 has its form validated as 'DynaValidator' extension and has a corresponding Jsp.

Can Action1 pass on control to Action2 bypassing the Validation of Action2 ?

Want Action2 to execute different logic based on where the request comes from.

Action2 can get request from the Jsp or another Action class.
So if the request from's from Action1 execute some functions and
if the request comes from Jsp execute some other functions

Is the above possible ? an example would be great.

Thanks in advance,
-Navi
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this link on how to chain actions.

If you want validation to occur under one circumstance and not another, I'd suggest you create two separate action mappaings both pointing to the same Action class, one specifying validate="true" and the other validate="false". In the Action class, you can tell how the action was invoked by calling the getPath method of the ActionMapping instance that is passed into the execute method as a parameter.
 
Navi Lock
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Merrill,

cool.. think that would work..

Let me try..

Thanks for the help...appreciate it.

-Navi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic