You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dirk Bergstrom <di...@juniper.net> on 2007/01/13 00:09:15 UTC

[S2] Access to devMode value

I need to find the value of the devMode flag from within my code.  Ideally I'd
have access to it from the ApplicationListener, so that I could set logging
levels and choose the correct database.  At the least, I need it in my
ActionSupport classes, so I can turn on Dojo debugging.

I've googled, and dug through the javadocs, but I can't find anything.

-- 
Dirk Bergstrom               dirk@juniper.net
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 408.745.3182           Fax: 408.745.8905

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Access to devMode value

Posted by Dirk Bergstrom <di...@juniper.net>.
Don Brown was heard to exclaim, On 01/12/07 18:01:
> If using the latest code, 

What's "latest code"?  Subversion trunk, or 2.0.1?  Probably doesn't matter,
since I'm waiting on Constant Configuration, which will be in the next version.
 That will allow me to define devMode in an xml entity that I can store outside
my source tree.

> you can have it injected into your action via:

Is there any way to get it during application startup?

Hmmm, I guess I can just have my application read the entity source.  Never mind.

> This holds true for any configuration value or internal framework object.

What constitutes an "internal framework object"?

Thanks for the tip.

> On 1/12/07, Dirk Bergstrom <di...@juniper.net> wrote:
>> I need to find the value of the devMode flag from within my code.  Ideally I'd
>> have access to it from the ApplicationListener, so that I could set logging
>> levels and choose the correct database.  At the least, I need it in my
>> ActionSupport classes, so I can turn on Dojo debugging.


-- 
Dirk Bergstrom               dirk@juniper.net
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 408.745.3182           Fax: 408.745.8905

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Access to devMode value

Posted by Don Brown <do...@gmail.com>.
If using the latest code, you can have it injected into your action via:

@Inject(StrutsConstants.STRUTS_DEVMODE)
public void setDevMode(String mode) {
  this.devMode = "true".equals(mode);
}

This holds true for any configuration value or internal framework object.

Don

On 1/12/07, Dirk Bergstrom <di...@juniper.net> wrote:
> I need to find the value of the devMode flag from within my code.  Ideally I'd
> have access to it from the ApplicationListener, so that I could set logging
> levels and choose the correct database.  At the least, I need it in my
> ActionSupport classes, so I can turn on Dojo debugging.
>
> I've googled, and dug through the javadocs, but I can't find anything.
>
> --
> Dirk Bergstrom               dirk@juniper.net
> _____________________________________________
> Juniper Networks Inc.,          Computer Geek
> Tel: 408.745.3182           Fax: 408.745.8905
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org