Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [S2] Access to devMode value

Don Brown

2007-01-12

Replies:

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 <dirk@(protected):
> 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@(protected)
> _____________________________________________
> Juniper Networks Inc.,       Computer Geek
> Tel: 408.745.3182       Fax: 408.745.8905
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.