Anandh
Anandh

Reputation: 13

Compilation in JSP

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!

Upvotes: 1

Views: 99

Answers (3)

Anandh
Anandh

Reputation: 13

Thanks fa ur quick responses..

I am using Netbeans 8.0.. During compilation in JSP whether same work directory to know java file and class file?

Upvotes: 0

Santhosh
Santhosh

Reputation: 8217

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

The servlet container will compile JSP into a class extending HttpServlet and use it for the webapp's lifetime.

Want to know where container put converted .java and .class file

You can find the generated source code in the application server's work directory. In for example in Tomcat, /work directory.

will it be available after request has been fulfilled.

On a JSP request, the servlet container will execute the compiled JSP class and send the generated output get displayed it in the web browser. Servlet container will have the file till the app's lifetime

Upvotes: 1

SMA
SMA

Reputation: 37103

If you are using tomcat then it would be in work directory:

tomcat
    work
        catalina
            localhost
                webappName/context
                    java package directories
                           xyz.java

Upvotes: 1

Related Questions