• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling jsp

 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any possibilities to compile a jsp into a servlet class
without accesing this jsp from the browser. Something like compiling a
.java into a .class. And please show me how, I would really appreciated. Thanks.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Part of the JSP 1.1 and 1.2 spec requires that your application server supports precompilation.
If you call the following URL in a browser, the JSP will compile but not execute:
http://host:port/someWebApp/somePage.jsp?jsp_precompile=true
Check with your application server's documentation to see if they also provide a class that will precompile a JSP without the use of a browser, for example, the HP Application Server's deployment tool, RadPak -- gives you the option to precompile JSPs upon deployment to the server, or you can use a commandline tool.
Hope that helps.
[ February 21, 2002: Message edited by: Jessica (Bradley) Sant ]
 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this error:
The requested resource (/someWebApp/somePage.jsp) is not available.

Originally posted by Jessica (Bradley) Sant:
Part of the JSP 1.1 and 1.2 spec requires that your application server supports precompilation.
If you call the following URL in a browser, the JSP will compile but not execute:
[URL=http://host ort/someWebApp/somePage.jsp?jsp_precompile=true]http://host ort/someWebApp/somePage.jsp?jsp_precompile=true[/URL]
Check with your application server's documentation to see if they also provide a class that will precompile a JSP without the use of a browser, for example, the HP Application Server's deployment tool, RadPak -- gives you the option to precompile JSPs upon deployment to the server, or you can use a commandline tool.
Hope that helps.
[ February 21, 2002: Message edited by: Jessica (Bradley) Sant ]
 
Greg Brouelette
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this error:
The requested resource (/someWebApp/somePage.jsp) is not available.

That's generally your web path. What AppServer are you using? In Tomcat you'll need to specify the location of your jsp's in (I think) the web.xml file. In WebSphere there's a web path text field in the GUI where you enter the location of your JSP's.
Also, some appservers (like WebSphere) have tools that will precompile all your JSP's at once as a batch process.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bobby, morkos:
I get this error:
The requested resource (/someWebApp/somePage.jsp) is not available.


http://host:port/someWebApp/somePage.jsp?jsp_precompile=true was an EXAMPLE of how you'd precompile a particular JSP.
* Change "someWebApp" to the name of the Web Application that contains your JSP.
* Change "somePage.jsp" to the name of an ACTUAL jsp in that web application that you'd like to precompile.
[ February 22, 2002: Message edited by: Jessica (Bradley) Sant ]
 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works perfectly now. Thanks a lot.
Originally posted by Jessica (Bradley) Sant:

[URL=http://host ort/someWebApp/somePage.jsp?jsp_precompile=true]http://host ort/someWebApp/somePage.jsp?jsp_precompile=true[/URL] was an EXAMPLE of how you'd precompile a particular JSP.
* Change "someWebApp" to the name of the Web Application that contains your JSP.
* Change "somePage.jsp" to the name of an ACTUAL jsp in that web application that you'd like to precompile.
[ February 22, 2002: Message edited by: Jessica (Bradley) Sant ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic