File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Compiling jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Compiling jsp" Watch "Compiling jsp" New topic
Author

Compiling jsp

bobby, morkos
Ranch Hand

Joined: Jan 04, 2002
Posts: 82
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

Joined: Oct 17, 2001
Posts: 4313

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 ]

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
bobby, morkos
Ranch Hand

Joined: Jan 04, 2002
Posts: 82
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

Joined: Jan 23, 2002
Posts: 144
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.


For a good Prime, call:<br />29819592777931214269172453467810429868925511217482600306406141434158089
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

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

Joined: Jan 04, 2002
Posts: 82
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiling jsp