aspose file tools*
The moose likes JSP and the fly likes Compile jsp into java class file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Compile jsp into java class file" Watch "Compile jsp into java class file" New topic
Author

Compile jsp into java class file

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I compile jsp into java class file, and then jar these files and application java files into web-inf/lib. and I delete web-inf/classes. All are successful. Then I deploy to Tomcat 5.5.

When I go to home page, I always get "resource not available" error. If I manually copy jsp files in, it will work fine. So it is related to the action I compile jsp file into class.

Any clues ?

Thanks.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Does the directory structure under 'classes' match the package structure of the compiled classes?

Did you create servlet entries and mappings for the JSPs in your deployment descriptor?


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

Joined: Dec 23, 2003
Posts: 798
=======
Did you create servlet entries and mappings for the JSPs in your deployment descriptor?
========
Yes, maybe I missed this. How to do this ?

Thanks.
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

I guess you will have to map your jsp-turned-servlets the same way you map any other servlet in your application.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Edward Chen:
Yes, maybe I missed this. How to do this ?


Do you know how to create a regular servlet entry and mapping?
[ August 30, 2007: Message edited by: Ben Souther ]
Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
Originally posted by Ben Souther:


Do you know how to create a regular servlet entry and mapping?

[ August 30, 2007: Message edited by: Ben Souther ]

I found that ONLY default page can't be loaded. If I put absolute address, it will be fine.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compile jsp into java class file