• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Complie a JSP Page  RSS feed

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pal,

Please let me know, How to complie a JSP page? and how to keep source file?

bye
Mallikarjuna
 
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container will compile the JSP page for you. It will generate a java file somewhere in the system and then compile it into a class. This class is then loaded by the container. Where the container plans to place this java file is container dependant.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to add to what John said, a JSP is always converted to a servlet, and the life cycle of a JSP includes page translation and compilation besides the init(), service(), destroy() methods of a servlet life cycle.

As far as the location of these compiled classes and .java files for the jsp, for tomcat the compiled jsp's can be found under the <tomcat-home>\work\Catalina\localhost\<web-app>\
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arjun,

Well as far as the Topic is concerned, about compiling a JSP page , You can do that using the jsp_precompile query String like this...


http://localhost:8080/Yogendra/scriptlessjsp.jsp?jsp_precompile=true
or simply
http://localhost:8080/Yogendra/scriptlessjsp.jsp?jsp_precompile

even if you dont append the value "=true" at the end , by default its true, so you are free to use any format given above. Also you can refer to the above 2 replies which too are the perfect way of explaination. As always John explains things very simply and accurately. Hats off to you John. :-)

Regards ,

Yogendra Joshi
 
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way to do it is to use Maven with one of the many excellent plug-ins that will do just what you're asking.*

For example, the Tomcat plugin (http://www.codeczar.com/products/maven-tomcat-plugin) will automatically compile all of your JSPs as classes and add an appropriate entry to your web.xml to run them directly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!