Hi,
We have put our code that manipulates the FormBeanConfigs in the init() 
method of our custom Plugin which is called before freeze. Our code adds 
some FormPropertyConfigs to the FormBeanConfigs. However we now get errors 
that the new property configs that we defined do not exist when calls are 
made to getDynaClass().getDynaProperty(<name>) because it appears that the 
introspect() method on DynaActionFormClass is called once which populates 
the dyna properties hash table/map in in DynaActionFormClass before init() 
on our plugin is called. 

How can we get the DynaActionFormClass for the DynaActionForm's configs 
that we are modifying to essentially re-introspect and rebuild their dyna 
properties themselves with our updated FormBeanConfigs? 

Karina






"Craig R. McClanahan" <[EMAIL PROTECTED]>
03/10/2003 07:55 PM
Please respond to "Struts Users Mailing List"

 
        To:     Struts Users Mailing List <[EMAIL PROTECTED]>
        cc: 
        Subject:        Re: DynaActionForm




On Mon, 10 Mar 2003 [EMAIL PROTECTED] wrote:

> Date: Mon, 10 Mar 2003 17:07:29 -0700
> From: [EMAIL PROTECTED]
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: DynaActionForm
>
> Hi,
> We are creating a derivitive of DynaActionForm that needs to add
> FormPropertyConfigs to the FormBeanConfig at runtime however are running
> into this frozen config thing. How can we get around this and why does
> Struts prevent this in the first place?
>

Struts freezes the configuration information because it uses HashMaps to
store the XxxConfig beans, and we don't want to have to synchronize on
them for every request (such as FindActionConfig()) just on the off chance
that someone might be trying to modify the configuration data.  Freezing
ensures that nobody will run into mysterious results from trying to read a
HashMap that someone else is trying to modify.

If you can calculate all your dynamic stuff at webapp startup time, you're
still in luck -- the freeze happens after PlugIns are initialized, so you
can use one of them to set up the stuff that was not in the config files.
If you really need to modify these structures at runtime, you're going to
need to create modified versions of the appropriate config classes -- and
be sure you synchronize on the accesses (paying the inevitable performance
cost of this).

> Thank you!

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to