• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Multiple forms - one jsp

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having a dilemma on how to handle two forms on one jsp page. The first form is basically a header with a drop down list in it. I have a form bean and an action mapping for that. The second form is a display of users from the database again with its own form bean and action mapping. Ultimately if the user changes the information on the drop down list the report under it will change as well, but I am not sure how I can get the data from the drop down list into the second form.

If I try to retrieve anything in the second action form that has to do with the first then I get a null pointer exception.

Do I need to set something up in my struts-config.xml that allows them to talk to each other or do I need to do something totally different?

Melissa
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using your action class to extend LookupDispatchAction instead of action, this class is made for multiple submit buttons. You can have one big form with two different submit buttons, it will call your class and jump to the appropriate execute method depending on which submit button was clicked. Sounds a little tricky but the struts API shows you exactly what you need to have in your action class to set this up, it's really quite easy
 
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic