Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create an formbean in action?

Status
Not open for further replies.

Rookee

Programmer
Nov 30, 2006
1
DE
Hey...

I want to create an formbean in an action, then the action forwards to an jsp. in this jsp the formbean should be availbe with

<logic:present name="myFormBean">
Hello
</logic:present>

How does it work or could I never self create an formbean than struts can use?

ActionCode:

ContactFormAdvanced contactForm = new ContactFormAdvanced(); contactForm.setEmail(form.getEmail()); request.getSession().setAttribute("contactFormAdvanced", contactForm);

Jsp Code:

<logic:present name="contactFormAdvanced">
Hello
</logic:present>

Normally if the struts framework see an actionform that is configured in the struts-config.xml (it is with the same name "contactFormAdvanced") and found in session. It must use it an the attributes...

Thanks for help
 
How do you access the JSP in the browser? In order to an Action to execute, the link must point to the Action defined in struts-config.xml (you can use <html:link action="blabla.do">link text</html:link>). If that's not your case, please provide more data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top