Saturday, September 20, 2014

WebSphere z/OS - Clearing JSP cache......

Sometimes during development.....I have found the need to use an embedded java server page...in several java server pages....to have a consistent look and feel. (see below)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<title>A Java Server Page</title>
</script>
</head>
<body>
<%@ include file="Header.jsp" %>

So let's say that this include file (Header.jsp) is in a java server page named NewCust.jsp. If we were to make a change to the Header.jsp file...and only the Header.jsp file.......WebSphere V7.1 currently would not realize that this file has been changed.  Since we want NewCust.jsp to be recompiled......its data has not changed..so WebSphere will use is currently compiled copy.  This will result in the changes made to Header.jsp not showing up in the NewCust.jsp.

There are two things that we can do in this instance:

1) Make a benign change to all of the java server pages that include the Header.jsp...so that their changed dates will be updated....this will force a compile in WebSphere Application Server.

2) Clear the WebSphere java server pages compiled cache.  This too will force WebSphere to re-compile all of the java server pages when they are accessed...at least the ones we remove from the cache.

To find the cache folder.....you will need to go to the OMVS, Unix System Services....and locate the cache folder.

/cellRoot/AppServer/profiles/default/temp/appNodeName/serverName/applicationName/applicationWARFileName/_NewCust.class

The portion of this path that will be specific to your particular installation, node, application and war file name....they are highlighted in red above.

In this directory....you will see your particular jsp compile class...preceded with an underscore.  In our example _NewCust.class.  You can simply remove this file to force a recompile.

Happy coding!!!!

No comments:

Post a Comment