File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Prepopulating data in different forms on the same jsp. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "Prepopulating data in different forms on the same jsp." Watch "Prepopulating data in different forms on the same jsp." New topic
Author

Prepopulating data in different forms on the same jsp.

Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 128
Howdy all.

I've got several different forms on a jsp page, but I can't figure out how to populate the data in others asides from the main one.

Typically I prepopulate like so:

But (AFAIK) that automatically uses the form provided by the action-mapping.

How do I specify a different form?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4695

You'll have to grab it from its scope (assuming it already exists).

Struts saves its forms as attributes with the form-bean names defined in the struts-config.xml

For instance,
<form-bean name="javaRanchForm" type="JavaRanchForm"/>

could be retrieved with:
(JavaRanchForm)session.getAttribute("javaRanchForm");

if at some point an ActionMapping used the form already with the scope of "session".
[ September 21, 2004: Message edited by: Marc Peabody ]

A good workman is known by his tools.
 
 
subject: Prepopulating data in different forms on the same jsp.
 
Threads others viewed
DynaValidatorForm question:
How do you access DynaValidatorForm properties in a JSP?
What is DynaValidatorForm
What is DynaAction ?
Multiple Form Handling in JSP and Servlets for File Uploading
MyEclipse, The Clear Choice