Weblogic 11g JSP cache

Normally,  jsp_servlet classes will be cached by Weblogic 11g in:

{BEA_WLS}\user_projects\domains\yourdomain\servers\yourserver\tmp\_WL_user\your_app_name

 

We always meet a strange problem: why JSP page is not up to date even after restart/redeploy application? This is mainly because the cache is not cleared.

Two solutions to solve this problem:

  1. Clean your domain/cache before redeploy.
  2. Define "jsp-descriptor" in webloigc.xml to ask weblogic precompile all modified JSPs when the Web application is deployed or re-deployed or when starting WebLogic Server
Here, I list some jsp-param which can help us to debug issues in JSP development with Weblogic server:
  • keepgenerated: true|false: Saves the Java files that are generated as an intermediary step in the JSP compilation process. Unless this parameter is set to true, the intermediate Java files are deleted after they are compiled.
  • precompile: true|false: When set to true, WebLogic Server continues precompiling all modified JSPs even if some of those JSPs fail during compilation. Only takes effect when precompile is set to true.
  • precompile-continue: true|false: When set to true, WebLogic Server automatically precompiles all modified JSPs when the Web application is deployed or re-deployed or when starting WebLogic Server.
Here is a demo of weblogic.xml:
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app>
  	<jsp-descriptor>
		<jsp-param>
			<!-- keepgenerated=true: Used to save generated jsp_servlet java class for JSP file. It will be used to debug jsp error. -->
			<param-name>keepgenerated</param-name>
			<param-value>false</param-value>
		</jsp-param>
		<jsp-param>
			<param-name>precompile</param-name>
			<param-value>true</param-value>
		</jsp-param>
		<jsp-param>
			<param-name>precompile-continue</param-name>
			<param-value>true</param-value>
		</jsp-param>
	</jsp-descriptor>
</weblogic-web-app>
 
For more details on weblogic jsp-descriptor, please refer to  weblogic.xml Deployment Descriptor Elements.

你可能感兴趣的:(weblogic)