aspose file tools*
The moose likes Tomcat and the fly likes JSP compilation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP compilation" Watch "JSP compilation" New topic
Author

JSP compilation

Rajeev roushan sharma
Ranch Hand

Joined: Jan 28, 2010
Posts: 50
Hi All!

During compilation of a JSP file, it will be first converted into a .java file then .class file after that it will be loaded by the container to serve request. I want to know where container put converted .java and .class file. will it be available after request has been fulfilled.

Thanks in advance!
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

Rajeev,
Which application server are you using? The location is server specific.

Also, some containers only store the Java file in memory or only produce it upon compilation error or leave this as a configurable option.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Rajeev roushan sharma
Ranch Hand

Joined: Jan 28, 2010
Posts: 50
Jeanne Boyarsky wrote:Rajeev,
Which application server are you using? The location is server specific.

Also, some containers only store the Java file in memory or only produce it upon compilation error or leave this as a configurable option.


Thanks Jeannne for your quick response
I am using Tomcat 6.0.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

There's a "work" directory that contains each app's intermediate files.
Rajeev roushan sharma
Ranch Hand

Joined: Jan 28, 2010
Posts: 50
David Newton wrote:There's a "work" directory that contains each app's intermediate files.


Thanks :) I did not get any intermediate file under work folder. Is there any way to configure where to put compiled JSP's intermediate java and class file ?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Rajeev roushan sharma wrote:
David Newton wrote:There's a "work" directory that contains each app's intermediate files.


Thanks :) I did not get any intermediate file under work folder. Is there any way to configure where to put compiled JSP's intermediate java and class file ?


Only in a general way. You can set the CATALINA_BASE environment variable, and that will retarget the parent directory for the work directory - as well as the temp directory (if not overridden), the logfiles, and the conf directory. On some operating systems, you can retarget the work directory itself via a filesystem link (which is occasionally useful if filesystem space is tight or you're based on read-only media).

You don't own the java or classfiles that come from JSPs and shouldn't be meddling with them in the course of ordinary application systems. It's fully within the rights of an appserver to discard the Java source entirely (or even bypass source generation) and to generate the classes directly into RAM without ever keeping permanent copies of the compiled JSPs anywhere in the filesystem. It's even possible that future Tomcat releases might choose to do so.

So unless your interest is academic or you plan to fork Tomcat and pay the expense of keeping the fork up to date as new Tomcat releases emerge, I recommend not worrying about it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kris Schneider
Ranch Hand

Joined: Feb 14, 2001
Posts: 71
Rajeev roushan sharma wrote:
David Newton wrote:There's a "work" directory that contains each app's intermediate files.


Thanks :) I did not get any intermediate file under work folder. Is there any way to configure where to put compiled JSP's intermediate java and class file ?


http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html#Configuration

Make sure keepgenerated has not been set to false.

Try playing with scratchdir to use a different directory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP compilation