• 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

display form class values on success page

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This should fall into the Really Stupid question section - all the books I have tell you how to manage a series of FORMS in struts. and the examples I see simpley forward to a final success page with geneic success text.

All I want to do is display some values that were gathered on stuts form to the user - like his name and what he registered for. I suspect that a [code]<bean:[code] tag is invloved - but how do i tell the success jsp page which bean - or does just "know"...
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On your input form, you tell struts which action to call using a tag like this: <html:form action="/myAction">

In your struts-config file, you tell struts which form bean to populate like this:
<form-bean name="myForm" type="com.mycompany.MyFormBean"></form-bean>
<action name="myForm" path="/myAction" scope="request" type="com.mycompany.MyAction"></action>

If you do this, struts populates MyFormBean for you when the form is submitted. If you want to display values from this bean in the next page, just put the instance of MyFormBean in some scope (request, session, or application) with the setAttribute() method and use the <bean:write> tag in the JSP to display its properties. The <bean:write> tag looks for the bean in any scope.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic