Changing the JSP refresh timer
A standard solution is to tell Weblogic to check JSP freshness more frequently by either setting the value in your web.xml
or in your weblogic.xml
.
In production mode, Weblogic won't check for new JSP versions (default value: -1) while it does each second in development mode (default value: 1).
The choice between modifying web.xml
or weblogic.xml
is up to you, regarding the application servers you target, being WebLogic only or not.
If you prefer to modify web.xml
, then set a value for the context parameter weblogic.jsp.pageCheckSeconds
as follows:
<context-param>
<param-name>weblogic.jsp.pageCheckSeconds</param-name>
<param-value>0</param-value>
</context-param>
If you prefer to modify weblogic.xml
, then set a value for parameter page-check-seconds
in the jsp-descriptor
section. Here is the relevant excerpt from the documentation:
Sets the interval, in seconds, at which WebLogic Server checks to see if JSP files have changed and need recompiling. Dependencies are also checked and recursively reloaded if changed.
The value -1 means never check the pages. This is the default value in a production environment.
The value 0 means always check the pages.
The value 1 means check the pages every second. This is the default value in a development environment.
In a production environment where changes to a JSP are rare, consider changing the value of pageCheckSeconds to 60 or greater, according to your tuning requirements.
Source: http://docs.oracle.com/cd/E21764_01/web.1111/e13712/weblogic_xml.htm#i1038490
Forcing redeployment
Restarting Weblogic server does not force it to redeploy a Web Application (especially in production mode).
Solution
Trigger explicitly the "redeploy" life-cycle operation using command line like this:
java -cp weblogic.jar weblogic.Deployer -redeploy [-remote -adminurl t3://hostname:hostport] -username login -password password -name webapp.name [-upload -source webapp.war]
Note that -redeploy
is WAYS much safer than -update
, esp. with Weblogic <= 10.x
Keep first block between [ ], only if the server is not local. Remove the [ ] in that case.
Keep second block between [ ], if you want to combine the WAR file uploading in the same step, which is way simpler. Remove the [ ] in that case.