• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple Action Class for single form bean and single JSP

 
Satyajit Bhadange
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on Struts 1.3.
I have one doubt.

I am writing a single JSP and Single ActionForm but there are multiple Action classes(doing specific tasks).

I want to write JSP,want to know how to write


and also how to call different action on form submit.
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is completely driven by struts-config in your case(since you have only 1 form and 1 JSP).
Firstly, to me i do not use the action class as a model part (debatable) instead i use it as controller (in case of earlier versions of Struts2). Just to minimize the number of action classes and struts mapping.

However you can achieve this in 2 ways
1. You can have more than one action mappings in struts-config with the same form. And while submitting the form from JS you can mention the URL corresponding to your action classes
2. On submit from JSP, you can always direction to one action class and from their based on requirement, conditionally forward it to other action classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic