You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcelo Vanzin <va...@rededc.com.br> on 2002/04/22 20:42:40 UTC

Re: Where is it best to populate default form bean collections et c?

Hoang, Hai wrote:
 > So, you are calling your ejb or delegate class from your formbean to
 > get the static data?  And how do you access it from the jsp? I am
 > just curious.

	No, the data is put in the form bean in the Action class. So, all the 
code to access the remote data is in the action class, I just have 
properties in the form bean to get/set this data.

	The way our actions work is kinda tricky and difficult to explain 
briefly, but we have many ways to ensure that the data is available when 
needed. Basicly, we do not use the perform() method directly; instead, 
we implement other methods that are called from the perform() in the 
superclass. So, we also have methods called before these, so that we can 
set up all the needed data (or, in this case, make sure that the 
required data is available).

	Inside the JSP, I access the data as I would access any other bean, using 
the form name (as defined in struts-config.xml) as the "name" attribute. 
The only problem is the html:options tag, but we had a different version 
so this would work also (and now in 1.1b there's the 
html:optionsCollection tag).

-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
vanza@rededc.com.br
"Life is too short to drink cheap beer"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>