0

i m a stater with jsp .... have installed Tomact 5.0.28. Its displaying server page when i type http://localhost:8080

now i have made a simple context.jsp file---->

<HTML>
<HEAD>
<TITLE>
Context
</TITLE>
</HEAD>
<BODY>
<%
out.println("First JSP APPLICATION");
%>
</BODY>
</HTML>

placed it in a folder ch in webapps folder of tomcat...

when i try to run it by
http://localhost:8080/ch/context.jsp

it shows the error

type Status report

message /Context.jsp

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

please help....

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks).

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by neeraj20gupta
0

You got general direction of the wind that files that you wish to deploy should be placed in webapps folder, unfortunately it is not full truth.
You need to provide your "ch" folder with minimal Tomcat deployment directory structure.

  1. Create new project folder in directory webapps (you already did this with creating new folder named ch)
  2. Place context.jsp in "ch" folder (you already did)
  3. In project folder create another folder called WEB-INF where you will save web.xml
  4. Create web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
    
    <web-app>
    <welcome-file-list>
    	    <welcome-file>context.jsp</welcome-file>
    </welcome-file-list>
    </web-app>
  5. Start server and call your JSP
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.