Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Struts dev.mode for a live site

Tags:

struts2

In the struts documentation they are saying that by setting

<constant name="struts.devMode" value="true" />

This will cause the site to load fastly.

So my question is is it possible to put this constant in live site so that it will load the live site fastly. Is there any problem with that?

Thanks

like image 610
anoop Avatar asked Dec 07 '22 17:12

anoop


1 Answers

You took it all wrong,struts.devMode when enabled, acts much friendlier, which can significantly speed up development.

When you have made the devMode=true in your config file this will help you in following steps

  1. Struts 2 will reload your resource bundles on every request (meaning you can change your .properties files, save them, and see the changes reflected on the next request).
  2. It will also reload your xml configuration files (struts.xml), your validation files, etc, on every request. This is useful for testing or finetuning your configuration, without having to redeploy your application every time.
  3. it will raise the level of debug or normally ignorable problems to errors.

In Short it is a weapon for the developer for enhance his development process by figuring out any error, as when enabled it will show yo much friendly and detailed error underlying the cause and any suggestion.

Here are more details for devMode Struts2 Development mode

It is never recommended to enabled this in your production as enabling this means you are reloading your configuration file /any other property files on each request which will definitely slow down the overall portal.

like image 100
Umesh Awasthi Avatar answered Mar 21 '23 05:03

Umesh Awasthi