Where Are Compiled Jsp Java (*_Jsp.Java) Files

Where are compiled JSP Java (*__jsp.java) files?

The compiled JSP files are by default available in the /work folder of the Tomcat environment. There should be a subfolder Catalina which in turn has a subfolder representing the domain name which defaults to localhost. There in turn should be the project folder which in turn contains package hierarchy org.apache.jsp with therein the compiled JSP files.

Tomcat
|-- backup
|-- bin
|-- conf
|-- lib
|-- logs
|-- temp
|-- webapps
`-- work
`-- Catalina
`-- localhost
`-- projectname
`-- org
`-- apache
`-- jsp
|-- survey_jsp.class
`-- survey_jsp.java <--- here

Unrelated to the concrete problem, there should be a root cause part in the stacktrace of the JspException which usually contains more detail about the real root cause of the problem. Read a bit further in the stacktrace. By the way, do you know that putting raw Java code in JSP files is considered a bad practice? It makes problems harder to debug as you encounter now.

tomcat and .class files

Your question has been answered here: "Where are compiled JSP Java (*_jsp.java) files?".

The compiled JSP files are by default available in the /work folder of the Tomcat environment.

Or, if you're using Eclipse IDE and publish the application within the workspace, which is the default behaviour, you may find the work directory in some path like:

workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\HelloWorld\org\apache\jsp\test_jsp.class

However, if you want all the compiled JSP (*_jsp.class) files, you have these options: Use Tomcat jspc tool with ant as instructed on the documentation; use wget to recursively request all the *.jsp pages from the tomcat server by issuing a command like below, or use your IDE's precompile JSP pages option to let the IDE do the job for you.

wget -r --no-parent -A.jsp http://domain/your-project/

so that it should all be cached by tomcat now.

Location of compiled JSP in WepSphere Application Server

You need to set the keepgenerated=true option in the ibm-web.ext.xml file. The generated sources will be stored in the Profile_Root/temp/node_name/server_name/EAR_App_Name/WAR_APP_Name/temp.

For more details check:

  • Getting the generated Java source for a JSP file
  • Configuring JSP engine parameters
  • JSP engine configuration parameters - keepgenerated

Where can I find the source or the compiled file for jsps generated by Tomcat?

Go to

apache-tomcat\work\Catalina

folder and go through the directory hierarchy to find .java and .class files.

WildFly 8 Where Are Compiled JSP?

compiled JSP files are into standalone/tmp/[application-name].war/org/apache/jsp.
For example, if you deployed an application named test.war, you will find the compiled JSP into C:\wildfly-8.0.0.Final\standalone\tmp\test.war\org\apache\jsp (Assuming you have installed WildFly on C:)

Who produce class file for jsp?

The servlet container(like tomcat) compile the jsp to java file ,and then compile the java file to class file through JDTCompiler or AntCompiler,the following code is implementation of create target compiler in Tomcat:

public Compiler createCompiler() throws JasperException {
if(this.jspCompiler != null) {
return this.jspCompiler;
} else {
this.jspCompiler = null;
if(this.options.getCompiler() == null) {
this.jspCompiler = this.createCompiler("org.apache.jasper.compiler.JDTCompiler");
if(this.jspCompiler == null) {
this.jspCompiler = this.createCompiler("org.apache.jasper.compiler.AntCompiler");
}
} else {
this.jspCompiler = this.createCompiler("org.apache.jasper.compiler.AntCompiler");
if(this.jspCompiler == null) {
this.jspCompiler = this.createCompiler("org.apache.jasper.compiler.JDTCompiler");
}
}

if(this.jspCompiler == null) {
throw new IllegalStateException(Localizer.getMessage("jsp.error.compiler"));
} else {
this.jspCompiler.init(this, this.jsw);
return this.jspCompiler;
}
}
}


Related Topics



Leave a reply



Submit