aspose file tools*
The moose likes Servlets and the fly likes deployment environment can only have complied file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "deployment environment can only have complied file?" Watch "deployment environment can only have complied file?" New topic
Author

deployment environment can only have complied file?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
True/False:

Is it must to compile Servlet before deploy?

Is it must to compile JSP before deploy?

My guesses are: True and True

Please comments.

Thanks.
pooja jain
greenhorn
Ranch Hand

Joined: Jan 12, 2005
Posts: 213
No, they can be compiled on first request.


:d
Nazneen Shaikh
Greenhorn

Joined: May 01, 2003
Posts: 21
I would say it is 1) true and 2) is false
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by pooja jain:
No, they can be compiled on first request.


I think, you are confusing between compiling and loading...

Nazneen,

Why false for JSP...
Thanks.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Depending on the container, it is possible to pre-compile the JSPs, otherwise they get created and compiled when they are first accessed. While the time for this is negligable considering the life of the JSP, it is sometimes desirable or necessary to precompile JSPs when deploying.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Servlets has to be compiled and placed(deployed) in web-inf/classes folder. Container will load the servlet .class files from here.

For jsp files Jasper(or) Jsp Container will do all the work of translating the jsp source code to .java files and compiling it to servlet .class files.

You can find the container generated .java and .class files of your jsp page in tomcat/work folder.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Vishnu Prakash:
Servlets has to be compiled and placed(deployed) in web-inf/classes folder. Container will load the servlet .class files from here.


Some containers will compile servlet code on demand.
I know Resin and Orion can do this.
Check your container's documentation.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
So the final answer is False and False. Because question is: is it must to compile....

Right?
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

So the final answer is False and False. Because question is: is it must to compile....


final answer would be "Based on Container "
Amarender Reddy
Ranch Hand

Joined: May 12, 2005
Posts: 54
final answer should be True and Based on Container

cheers
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No, the answer is that it's not a True/False question.
Some containers can compile servlets on demand and others can't.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Ben Souther:
No, the answer is that it's not a True/False question.
Some containers can compile servlets on demand and others can't.


Yes, But if it is true/false question then final answer would be false and false.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by rathi ji:
Yes, But if it is true/false question then final answer would be false and false.


If it is about true/false then I wouldn't attempt it, no matter what would be the result.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deployment environment can only have complied file?
 
Similar Threads
Tomcat class file problem
Deploying Servlet in Webshere
2 Interesting Mock Questions
How to set Default button in Swing
org.apache.jasper.JasperException: Unable to compile class for JSP: