aspose file tools*
The moose likes JSP and the fly likes Service not found error when trying to create jsp templates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Service not found error when trying to create jsp templates" Watch "Service not found error when trying to create jsp templates" New topic
Author

Service not found error when trying to create jsp templates

achuthan mukundarajan
Ranch Hand

Joined: May 30, 2012
Posts: 87
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

Joined: Jun 23, 2012
Posts: 13

hi

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

try to include them as .html files.


regards
Sailaja
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Mar 17, 2012
Posts: 892
    
    9
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

Joined: May 30, 2012
Posts: 87
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

Joined: Jan 10, 2002
Posts: 61653
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
achuthan mukundarajan
Ranch Hand

Joined: May 30, 2012
Posts: 87
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

Joined: Jan 10, 2002
Posts: 61653
    
  67

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

Joined: May 30, 2012
Posts: 87
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

Joined: Jan 10, 2002
Posts: 61653
    
  67

ItDoesntWorkIsUseless
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Service not found error when trying to create jsp templates