• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Service not found error when trying to create jsp templates

 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created two pages header.jsp and footer.jsp and tried to include them in the main.jsp .So that i could get a master page like effect . But i got a service not found error. I use netbeans and when i run the main.jsp alone i get the desired result. But if i try to run the project as a whole i get the http 404 service not found error.

Also i have set the start page as main.jsp in the properties of the project.

The code for main.jsp is given below:



The code for header.jsp i given below:


The code for footer.jsp is given below:



Why do i get the service not found error?
 
sailaja usha
Greenhorn
Posts: 13
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

the header and footer pages are just only the html pages right...!

try to include them as .html files.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where the main.jsp resides? and it is always safe to use context relative path as in <%@include file="/WEB-INF/header.jsp"%> . but I am not sure about 404 though...
 
E Armitage
Rancher
Posts: 989
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What url are you trying to access when you get the 404? Did you check the logs to see that the application actually deployed successfully?

P.S Consider looking at using jsp-config properties <include-prelude> and <include-coda> in the web.xml for including footers and headers.
 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no web.xml as there is no servlet used . There is only a sun-web.xml. I tried using context relative path and still the same error persists. I tried using html pages instead of jsp pages, but still no change in the error. My doubt is that the application is trying to load the start page as a page other than the main page. Where do i change that?

I changed the property by going to the properties of the current project .But still no change.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
web.xml is not just for servlets. It configures the web application.

And no servlets? Is this 1998? Please read this article and this JspFaq entry.
 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the web.xml. I even added a servlet eventhough i dont need one for this example.Still the error persists.

Any new solutions.?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you just waiting for answers? Why aren't you trying out different scenarios? For example, did it occur you to you to try "/WEB-INF/..." rather than "WEB-INF/..."?
 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote: For example, did it occur you to you to try "/WEB-INF/..." rather than "WEB-INF/..."?


Tried that ...not working... Again ...any other solutions?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic