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....

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

thanks a lot peter_budo ......... it worked..........:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.