• Post Reply Bookmark Topic Watch Topic
  • New Topic

i am not able to run this servlet.. pls reply

 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii
i m trying my servlet eg...

have created directory "hsmd" under "webapps"

and put my java file under webapps->hsmd->WEB-INF->classes->com->testing.java

i have put web.xml under WEB-INF

with the following..

<?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/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>testinner</servlet-name>
<servlet-class>com.testing</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>testinner</servlet-name>
<url-pattern>/abc</url-pattern>
</servlet-mapping>
</web-app>


and under testing,java

import javax.servlet.*;
import javax.http.*;
import java.io.*;

public class testing extends HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
{
res.setContextType("text/html");

PrintWriter out =res.getWriter();
out.println("<html> Hack the matrix </html>");

}
}



if i put url like http://127.0.0.1:8080/hsmd/abc
then following error comes
--------------------------------------------------------------------------------

type Status report

message Servlet testinner is not available

description The requested resource (Servlet testinner is not available) is not available.


why i m getting this error ...

i have done everything according to book HFsj

pls reply
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you compile it and put the class file under WEB-INF/classes or did you just put the source file (.jsp) there?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!