Pretty straight forward, the source code seems unnecessary given my answer,
but whatever:
I use a context listener that calls this line when the apache context is
active...
public void contextInitialized (ServletContextEvent sce)
{
if(!Server.isLive()) Dispatcher.addDispatcherListener(new
DebugDispatchListener());
}
/** Listens to the Struts dispatch lifecycle and enables debugging on all
dispatchers. Used when !Server.isLive(); **/
class DebugDispatchListener implements DispatcherListener
{
public void dispatcherDestroyed(Dispatcher arg0) { }
public void dispatcherInitialized(Dispatcher dispatcher)
{
dispatcher.setDevMode("true");
}
}
sheltonn wrote:
>
> Code, please.
>
>
> Norris Shelton
> Software Engineer
> Sun Certified Java 1.1 Programmer
> Shelton Consulting, LLC
> ICQ# 26487421
> AIM NorrisEShelton
> YIM norrisshelton
>
>
>
>
> ________________________________
> From: laserjim <[email protected]>
> To: [email protected]
> Sent: Friday, May 22, 2009 8:42:42 AM
> Subject: Re: Specify DevMode Dynamically at Runtime
>
>
> SOLVED: When you're in debug mode, add a dispatch initialization listener
> to
> the Struts Dispatch class; the dispatch listener can call
> setDevMode("true");. Tested, works, Struts 2.1.6
>
>
>
> laserjim wrote:
>>
>> Hello,
>>
>> I have a struts application. Sometimes, at runtime, I decide I want to
>> enable dev mode. Modifying struts.properties requires redeploying the
>> webapp. Is there a way to enable devmode dynamically?
>>
>> Thanks!
>>
>
> --
> View this message in context:
> http://www.nabble.com/Specify-DevMode-Dynamically-at-Runtime-tp23668635p23669706.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
>
--
View this message in context:
http://www.nabble.com/Specify-DevMode-Dynamically-at-Runtime-tp23668635p23676673.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]