Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile jsp into java class file

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
=======
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
Posts: 354
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic