You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Brandon Goodin <ma...@phase.ws> on 2003/05/05 15:40:39 UTC
Reloading struts-config form-property
I know there are some issues regarding reloading the struts-config.xml
without a restart of the server. But, would there be any issues in regards
to reloading the form-bean and form-property configuration elements? The
only reason why I ask is regards to testing. Often when I am hardcoding
ActionForm classes I don't have to restart the server when I make changes to
the class. But, if I am using the form-property in the struts-config.xml, I
have to restart the server each time. I would be more than happy to explore
a patch. But, I was just wondering what the developer's experties would
advise. This would really entail repopulating the FormBeanConfig and
FormPropertyConfig.
Brandon Goodin
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: Re: Reloading struts-config form-property
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Mon, 5 May 2003, Kent Sølvsten Rasmussen wrote:
> Date: Mon, 05 May 2003 18:43:22 +0200
> From: Kent Sølvsten Rasmussen <ke...@aarhusmail.dk>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: Struts Developers List <st...@jakarta.apache.org>
> Subject: Re: Re: Reloading struts-config form-property
>
> Wouldn't it be possible to solve the first issue by using the "FastMap" implementations in commons-collections?
>
It was that way in 1.0, but it's irrelevant in 1.1.
> But anyway, toying with class reloading inside Struts is not a good
> idea, I guess. (I suppose I am not the only one having fun with
> classloaders and commons-logging, and these challenges are not likely to
> become less, if Struts starts using its own classloader).
>
J2EE containers won't let apps create classloaders without lots of special
handwaving (i.e. editing of security manager permissions files).
> Kent
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: Re: Reloading struts-config form-property
Posted by Kent Sølvsten Rasmussen <ke...@aarhusmail.dk>.
Wouldn't it be possible to solve the first issue by using the "FastMap" implementations in commons-collections?
But anyway, toying with class reloading inside Struts is not a good idea, I guess. (I suppose I am not the only one having fun with classloaders and commons-logging, and these challenges are not likely to become less, if Struts starts using its own classloader).
Kent
Craig R. McClanahan <cr...@apache.org> wrote:
>
>
> On Mon, 5 May 2003, Brandon Goodin wrote:
>
> > Date: Mon, 5 May 2003 07:40:39 -0600
> > From: Brandon Goodin <ma...@phase.ws>
> > Reply-To: Struts Developers List
> <st...@jakarta.apache.org>
> > To: Struts Dev <st...@jakarta.apache.org>
> > Subject: Reloading struts-config form-property
> >
> > I know there are some issues regarding reloading the
> struts-config.xml
> > without a restart of the server. But, would there be any
> issues in regards
> > to reloading the form-bean and form-property configuration
> elements?
>
> Two major ones:
>
> * We'd have to synchronize all accesses to the config
> structures,
> thereby slowing down all the lookups.
>
> * Even if we allowed you to modify struts-config.xml
> dynamically,
> that wouldn't enable access to new or replaced classes
> (actions,
> form beans, etc.) that might have come along at the same
> time.
> Doing half a change would be *much* more confusing than
> not doing
> it at all.
>
> > The
> > only reason why I ask is regards to testing. Often when I
> am hardcoding
> > ActionForm classes I don't have to restart the server when
> I make changes to
> > the class.
>
> > But, if I am using the form-property in the
> struts-config.xml, I
> > have to restart the server each time. I would be more than
> happy to explore
> > a patch. But, I was just wondering what the developer's
> experties would
> > advise. This would really entail repopulating the
> FormBeanConfig and
> > FormPropertyConfig.
> >
>
> If we allow dynamic reloads of the config, people are going
> to expect
> dynamic reloads of the classes as well. That is not
> something Struts can
> provide -- that's the container's issue.
>
> Sounds like you should investigate the dynamic application
> reload
> facilities of your servlet container. I use Tomcat very
> heavily for
> development, taking advantage of the Manager webapp and its
> support for
> custom Ant tasks:
>
>
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/manager-howt
> o.html
>
> and the only time I ever restart Tomcat is to switch
> versions. A typical
> "ant reload" command for a big Struts app takes less than 3
> seconds.
>
> > Brandon Goodin
>
> Craig
>
> ------------------------------------------------------------
> ---------
> To unsubscribe, e-mail:
> struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: Reloading struts-config form-property
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Mon, 5 May 2003, Brandon Goodin wrote:
> Date: Mon, 5 May 2003 07:40:39 -0600
> From: Brandon Goodin <ma...@phase.ws>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: Struts Dev <st...@jakarta.apache.org>
> Subject: Reloading struts-config form-property
>
> I know there are some issues regarding reloading the struts-config.xml
> without a restart of the server. But, would there be any issues in regards
> to reloading the form-bean and form-property configuration elements?
Two major ones:
* We'd have to synchronize all accesses to the config structures,
thereby slowing down all the lookups.
* Even if we allowed you to modify struts-config.xml dynamically,
that wouldn't enable access to new or replaced classes (actions,
form beans, etc.) that might have come along at the same time.
Doing half a change would be *much* more confusing than not doing
it at all.
> The
> only reason why I ask is regards to testing. Often when I am hardcoding
> ActionForm classes I don't have to restart the server when I make changes to
> the class.
> But, if I am using the form-property in the struts-config.xml, I
> have to restart the server each time. I would be more than happy to explore
> a patch. But, I was just wondering what the developer's experties would
> advise. This would really entail repopulating the FormBeanConfig and
> FormPropertyConfig.
>
If we allow dynamic reloads of the config, people are going to expect
dynamic reloads of the classes as well. That is not something Struts can
provide -- that's the container's issue.
Sounds like you should investigate the dynamic application reload
facilities of your servlet container. I use Tomcat very heavily for
development, taking advantage of the Manager webapp and its support for
custom Ant tasks:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/manager-howto.html
and the only time I ever restart Tomcat is to switch versions. A typical
"ant reload" command for a big Struts app takes less than 3 seconds.
> Brandon Goodin
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org