Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The requested resource (myjsp/first.jsp) is not available 1

Status
Not open for further replies.

SwapSawe

Programmer
Apr 24, 2001
148
0
0
US
Hi !!!

I have installed Tomcat v5.0.25 and was able to surf through the pages in $CATALINA_HOME/webapps/examples but when i created my own directory $CATALINA_HOME/webapps/myjsp and put a simple HelloWorld println in it. I got the following error >>

HTTP Status 404 - myjsp/first.jsp

type Status report

message myjsp/first.jsp

description The requested resource (myjsp/first.jsp) is not available.

I would be thankful for any help in this regard.

I have a wild idea that there needs some configurations in server.xml and web.xml, but not even faintest what it actually is.

Thanx in Advance.
SwapSawe.

P.S. This is my jsp file -(so simple)

<HTML>
<TITLE>The JSP Test Page</TITLE>
<HEAD>HELLO WORLD !!!</HEAD>
<BODY>
HelloWorld!!!
<%
out.println("-- so says the test program.");
%>
</BODY>
</HTML>
 
To create a web application do the following:

In your directory under your jakarat-tomcat directory
C:\jakarta-tomcat-4.1.12\webapps in my case. Create your directory myWebApp.

under myWebApp create the following directory WEB-INF under WEB-INF create a web.xml file at this time just add the following to your web.xml
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" " >
<web-app>
</web-app>

This is where your servlet mapping goes go:

Also create the directory classes, this is where your servlet classes go.

umder your directory myWebApp put your JSP page in.

start tomcat up.

point your browser at and it should display the page.

Hope this helps Tony
 
For tomcat to recognize your "myjsp" context, you must have a WEB-INF directory : ie

webapps/myjsp/WEB-INF

You don't actually need the web.xml in there (although its a good idea to get used to it)

--------------------------------------------------
Free Database Connection Pooling Software
 
Hello !!!

I did make the changes and the page actually worked. I first didnot create the web.xml as suggested by sedj. But the page won't start still, and then I created the web.xml as told by Anthony and BINGO !!! Thanks both of you for your help.

Reminds me of an old proverb,
As iron sharpeneth the iron so does man his counterpart.

Thanks and Regards,
SwapSawe.
 
bizaar - I can run a context with no web.xml.

Still, nevermind, glad you got it working !

--------------------------------------------------
Free Database Connection Pooling Software
 
Dear all,
I am a beginner. I tried writing the hello world described by swapsawe using notepad. And I did all the above mentioned.
I can load the page but I cannot see the words displayed using the script
ie.
I cant see

"-- so says the test program."

Can anyone please suggest me what I missed?

Many Thanks!
Pancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top