• 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

Multiple Action Class for single form bean and single JSP

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic