File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes why this error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "why this error" Watch "why this error" New topic
Author

why this error

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class first extends HttpServlet{

public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{
PrintWriter out=res.getWriter();
out.println("This is my first servlet");
}
}


Dear sir in the above code if i will not extend the class first from that of HttpServlet and then when i am deploying then i m getting an error message that Noservlet class was added in the war module why sir why? although i am using J2EE server.

with regard

Arun kumar maalik
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41509
    
  53
You don't need to extend HttpServlet, but you do need to implement Servlet, so that the servlet lifecycle methods are available to be used by the container. But why wouldn't you want to extend HttpServlet - it does a number of useful things that you would have to program yourself otherwise (e.g., the dispatching to the doXYZ methods).


Ping & DNS - my free Android networking tools app
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
Which J2EE server you are using? Maybe you can post your web.xml here for further analysis


SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
gopinathang nathan
Ranch Hand

Joined: Oct 28, 2006
Posts: 41
For me it seems to be, 'I need only accelerator, brake, steering and gear. i dont want anyother things for my car, apart from these'
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why this error