Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Glassfish 2.1 stores cached JSP?

I'm looking for some information I haven't found anywhere else, as title says: I cannot find where glassfish is storing JSP pages upon runtime compilation, I already looked in the following directories:

  • WEB-INF/jsp under my deployed EAR, doesn't exist
  • domain1/generated/jsp/j2ee-apps/etc etc has no .java files
  • I made a search in the whole glassfish folder and I didn't find any .java files related to JSPs...

Any other hint?

Do I have to setup Glassfish in some way? Setup some properties? (I set jspCachingEnabled=true in the web-container only)

Thanks in advance.

like image 756
OverLex Avatar asked May 17 '11 15:05

OverLex


1 Answers

GlassFish does not keep the generated java sources for a jsp after they have been compiled by default. You can change that by adding the following snippet into your sun-web.xml file...

  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java code.</description>
    </property>

If your jsp (mypage.jsp) is in a war file (mywebapp.war), then the java file will be under

%GLASSFISH_HOME%\domains\domain1\generated\jsp\j2ee-modules\mywebapp_war\org\apache\jsp\mypage_jsp.java

If your jsp (mypage.jsp) is in a war file (mywebapp.war) that is part of an EAR (myentapp.ear) then the java file will be under

%GLASSFISH_HOME%\domains\domain1\generated\jsp\j2ee-apps\myentapp\mywebapp_war\org\apache\jsp\mypage_jsp.java
like image 105
vkraemer Avatar answered Sep 20 '22 15:09

vkraemer