Cannot find javax.servlet in J2EE

I am learning about servlet programming. I am using JBuilder-student edition. I downloaded J2EE. I changed the project properties in JBuilder to use the java.exe in J2EE, but when I try importing javax.servlet or the like, it does not show that javax has such a package. Please help. I am working on this project with a professor, and I have to show some work done soon! I cannot get started with my work unless I get javax.servlet.
I hope somebody can help me.
Thank you,

It seemed that the installation did not unzip the j2ee.WAR, which contains the servlet stuff.(or is it not supposed to?) I then added the folder j2ee to the class path, and it works. I am dumb enough not to understand how it worked, could someone explain please.
Thank you

Similar Messages

  • Cannot find javax.servlet package

    I have just downloaded and installed the latest JEE SDK having installed Tomcat on a Linux box so that I can start getting to know JSP.
    I am following an example in a book I have for this Servlet...
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.IOException;
    public class BasicServlet extends HttpServlet {
         public void doGet (HttpServletRequest req, HttpServletResponse res)
              throws IOException {
              ServletOutputStream out = res.getOutputStream();
              res.setContentType("text/html");
              out.println("<html><head><title>Basic Servlet</title></head>");
              out.println("<body>Hello World</body></html>");
    I am using Textpad to write and compile my java and when I try to compile I get errors basically saying that it cannot find the first 2 packages I am trying to import (it manages to find the IOException fine)
    Any ideas why? I suspect that the servlet package is not in the classpath but I do no know where the package is in order to add it to my class path.
    many thanks

    I have just downloaded and installed the latest JEE
    SDK having installed Tomcat on a Linux box so that I
    can start getting to know JSP.
    I am following an example in a book I have for this
    Servlet...
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.IOException;
    public class BasicServlet extends HttpServlet {
    public void doGet (HttpServletRequest req,
    , HttpServletResponse res)
              throws IOException {
              ServletOutputStream out = res.getOutputStream();
              res.setContentType("text/html");
    out.println("<html><head><title>Basic
    ic Servlet</title></head>");
              out.println("<body>Hello World</body></html>");
    I am using Textpad to write and compile my java and
    when I try to compile I get errors basically saying
    that it cannot find the first 2 packages I am trying
    to import (it manages to find the IOException fine)
    Any ideas why? I suspect that the servlet package is
    not in the classpath but I do no know where the
    package is in order to add it to my class path.
    many thanksHave u included your servletapi.jar into classpath
    If u havnt . set classpath to point to servletapi.jar
    if it helps .. release dukes.
    sudhir nimavat
    http://www.jyog.com

  • I cannot find javax.servlet package in j2sdk-1.4.0-beta3

    I just download and install j2sdk-1.4.0-beta3 and progam a very simple program use import javax.servlet.* and compile it, there is a mistake:
    package javax.servlet.* does not exist
    And I check the doc of j2sdk-1.4.0-beta3,I also can not find package javax.servlet.So where could I find this package? Need I configure somewhere or download another products?

    Hi,
    You can go to http://java.sun.com/products/servlet/download.html,
    download the servlet 2.3 class files, add the zip file to the classpath.

  • Javac cannot find javax.servlet.*; package

    getting an error when I try to compile code that contains the line:
    import javax.servlet.jsp.*;
    import javax .servlet.*;
    Yet, other classes in javax can be seen by the compiler such as javax.swing.*;

    I had to download the servlet specification from sun as it wasn't in my jdk (I prefer stripped down versions). Then I placed the jar file in my classpath.
    Alternatively, if you are already running tomcat you can point to the servlet api jar file in the lib directory.
    And a clear indication that the person stumbling like
    that shouldn't try writing servlets yet, as he
    clearly lacks knowledge about what's even in the
    standard API and what isn't.That's a clear indication that the person making such comments should not be on the forums as the idea is to help people and encourage people.

  • Cann't find javax.servlet.*

    Hi there!
    I cann't compile a servlet by means of ant...
    It cann't find javax.servlet.*
    I've searched for it in jakarta-tomcat-5.0.18 directory but didn't find anything...
    Where is it situated?

    It should be in %CATALINA_HOME%/common/lib/servlet.jar or %CATALINA_HOME%/common/lib/j2ee.jar

  • Getting javac to find javax.servlet package

    Hey all. I'm trying to get Servlets to run on my computer. I'm using jdk1.4, it didn't have the javax.servlet package to start off with. I downloaded jsdk2.0, which includes the javax.servlet package. I can't get the javac compiler to find these classes no matter what I do, I copied the entire javax/servlet folder into the jdk1.4/src.zip file that seemed to have all the other import files, I copied the jsdk.jar file into jdk1.4/lib/ folder, that didn't work either. In my batch file that sets the path for jdk, I added set classpath = c:\jsdk2.0\lib\jsdk.jar and that didn't work. I really can't seem to get javac to find these classes. Any help is greatly appreciated!

    The above advice is incorrect and can lead you to many problems.
    You should have nothing in your CLASSPATH environment variable immediately after installing J2SDK 1.4.1.
    You then have to install the Servlet API by pointing your CLASSPATH env. var. to it. To do this depends on the version of the Servlet spec. that you have as some of the olders ones were distributed as jar files, and the latest I believe is a set of classes to be extracted.
    At the end of the day, you must point your CLASSPATH to the Servlet API. Read up on how to set the CLASSPATH. Also, don't forget to include the current working directory (.) in your CLASSPATH after manually setting it.
    Good luck !!
    Tony Morris
    Software Engineer, IBM
    Gold Coast, Australia

  • Cannot find javax.ejb.CreateException fix classpath

    Hi Guys,
    I have made a Webdynpro in which I am using an EJB in the libraries of the project. When I access the classes of EJB I am getting a complie time error saying
    Cannot find class file for javax.ejb.CreateException. Fix the classpath then try rebuilding this project.
    Can you tell me how to fix this.
    Regards,
    Khusro Habib

    Hi,
    Guys I was able to solve this problem, by adding
    C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.tssap.ext.libs.j2ee_1.3.0\lib\ejb20.jar
    into the project properties>> in the Java Buildpath adding external jars.
    Khusro Habib

  • Tomcat 5 can�t find javax.servlet.http.HttpServlet

    Hi.
    I don�t know if this is a simple question or not, but i didn�t find anything solving this problem and
    i�m new to tomcat......
    I�m trying to deploy my web application in my system. (Windows XP , j2sdk1.4.2_02, jakarta Tomcat 5, jakarta struts 1.1 and jakarta taglibs 1.1).No problems while compiling the .java classes and checked all the .jar files that my application needs to work (or that is what I think). I expand my .war file at /webapps on tomcat directory and startup Tomcat. Tomcat starts up but while starting I get the following errors...
    17-feb-2004 17:58:50 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on port 8080
    17-feb-2004 17:58:51 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 4948 ms
    17-feb-2004 17:58:51 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    17-feb-2004 17:58:51 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.0.18
    17-feb-2004 17:58:51 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    17-feb-2004 17:58:51 org.apache.catalina.core.StandardHost getDeployer
    INFO: Create Host deployer for direct deployment ( non-jmx )
    17-feb-2004 17:58:51 org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\softProyecto\Tomcat5\conf\Catalina\localhost\admin.xml
    17-feb-2004 17:58:55 org.apache.commons.digester.Digester endElement
    GRAVE: End event threw exception
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
         at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
         at org.apache.commons.digester.Rule.end(Rule.java:276)
         at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
         at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:123)
         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.apache.commons.digester.Digester.parse(Digester.java:1567)
         at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:520)
         at org.apache.catalina.core.StandardHost.install(StandardHost.java:906)
         at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:527)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
         at org.apache.catalina.core.StandardService.start(StandardService.java:519)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
    Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    it seems like C:\softProyecto\Tomcat5\conf\Catalina\localhost\admin.xml (C:\softproyecto\tomcat5 = tomcat�s home directory) needs javax.servlet.http.HttpServlet. And that comes from a Tomcat .jar file, i think.
    After more and more messages..... here it comes my application (MapasRuido)...which needs javax.servlet.http.HttpServlet and compiled ok at compiling time!
    INFO: Installing web application at context path /MapasRuido from URL file:C:\softProyecto\Tomcat5\webapps\MapasRuido
    17-feb-2004 18:02:48 org.apache.catalina.startup.HostConfig deployDirectories
    GRAVE: Error durante el despliegue del directorio MapasRuido de la aplicaci�n web
    java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1296)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1677)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:900)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1350)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1677)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:900)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1350)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:979)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3960)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4283)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
         at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:320)
         at org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:727)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:477)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
         at org.apache.catalina.core.StandardService.start(StandardService.java:519)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
    17-feb-2004 18:02:48 org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path from URL file:C:\softProyecto\Tomcat5\webapps\ROOT
    17-feb-2004 18:02:48 org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /servlets-examples from URL file:C:\softProyecto\Tomcat5\webapps\servlets-examples
    17-feb-2004 18:02:48 org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /tomcat-docs from URL file:C:\softProyecto\Tomcat5\webapps\tomcat-docs
    17-feb-2004 18:02:49 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on port 8080
    tomcat�s web applications servlets-examples and tomcat-docs work fine, but my application doesn�t. Is there any relation between those errors? any idea about what happens?
    Thank you in advance.

    "...The CLASSPATH is ignored by Tomcat, of course. AND javac. AND java. AND Eclipse. AND NetBeans. AND JBuilder. And just about everything else in the Java universe..."
    What I mean by this, of course, is that each of these requires you to set the CLASSPATH in the way they expect. None of them even looks for a system environment variable named CLASSPATH. You can waste a lot of time thinking that your CLASSPATH is "all set", but it's not.
    Tomcat assumes the following for your Web app's CLASSPATH:
    (0) The JDK rt.jar, of course,
    (1) All the JARs in TOMCAT_HOME/common/lib,
    (2) All the JARs in your WEB-INF/lib,
    (3) All the .class files in your WEB-INF/classes
    That's it. (Maybe one or two others, but those are the important ones.)
    Eclipse and NetBeans have their own way to set CLASSPATH for each project. You'll have to learn how for those IDEs.
    The CLASSPATH is still vitally important. The system environment variable just isn't part of it. - MOD

  • Cannot find javax

    Hi I hit 2 problem here...
    1) My jbuilder got corrupted when I closed it without saving my project and I hit the following error
    "Fail to start Java VM:193"
    May I know how am I going to revive it back??
    2) Left without any choice, I compile my java file from the jdk1.3\bin directory... and I hit this error--( basically I import javax package and I compile them in dos mode using javac.)
    testAppln.java:10: package javax does not exist
    import javax.*;
    ^
    1 error
    I had include those classpath that store all the javax folder but still I cannot compile successfully.....Pls help.........:((((

    The rt.jar that hold all of the "standard library" classes, java... javax... Are not part of the "user" classpath. Instead, they are part of the "bootClassPath" so the users don't have to worry about it.
    So basically if you can't find javax.*; for an import your installation of the JRE is messed up. You can try to set the bootClassPath to the path of rt.jar and see if this is true with the following command.
    java -XbootClassPath:c:\jdk1.3\jre\lib\rt.jar MyMain
    experiment with that, and see if that works. Or just reinstall :)

  • Cannot find javax.management.snmp

    Dear all,
    I have a question hope yours could help me. Where can I find the javax.management.snmp package. I have already browse the ..\JavaManagement web page, but cannot find it.
    Could anyone help me?
    Thanks a lot.
    Regards,
    Vincent

    http://java.sun.com/products/jdmk/

  • Cannot find javax.jws.WebService

    Hello
    I'm kinda new to this web service thing. I tried to run the hello program using jdk 1.5 update 5. It said it cannot find the javax.jws.WebService. Does anyone know where does this package located so I can set the environment variables? Or if anyone can give me step by step guide for setting the environment to deploy a web service it'd be greatly appreciated.
    Thanks
    SqW

    I'm using this way...
    If you installed Java 1.5, then make JRE directory like below.
    %JAVA_HOME\jre\lib
    C:\Program Files\Java\jre1.5.0_04\lib
    Copy all JWSDP 1.6's jar file to JRE\lib\ext folder..
    Then, do not pay careful attention to classpath..

  • Cannot import javax.servlet onto classpath

    Hi guys, newbie question.
    Im using jedit on linux; compiling with j2sdk1.4.2_04 but it will not pick up the javax.serlet
    classes!! Is there an add on I need to download to develop j2ee stuff, as I thought j2sdk1.4.2_04 was all that was required.
    Thanks in advance

    Wrong. You need a JAR that has the javax.servlet and javax.servlet.http packages, and they don't come with the J2SE.
    If you want to run servlets/JSPs, you must have a servlet/JSP engine. If you already have one, root around for the servlet JAR. If don't, download Tomcat. It's Sun's reference implementation for the servlet/JSP specifications. The servlet JAR will be in the TOMCAT_HOME/common/lib directory.

  • Where can i find javax.servlet.http.httpServletRequest in weblogic jars

    Hi,
    i'm migrating from weblogic 8 to weblogic 10.3.
    in my java codes, i use import javax.servlet.http.httpServletRequest. Previously this package can in found in weblogic.jar in weblogic 8.
    However weblogic.jar for 10.3 does not have this package. Where can i find this package?
    Thanks

    oh i see. the api.jar has the indicate the path to the servlet package.
    /modules/javax.servlet_1.0.0.0-2-5.jar.
    Thanks for the guidance.:)

  • Cannot find the servlet--can anyone pls help

    Hi,
    I am trying to run an example servlet the code is as follows:
    Example.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <Title>Example</Title>
    </HEAD>
    <BODY>
    <form action="\example\classes.ShowParameters" method="post">
    Name: <input type="textbox" size="10">
    Number:<input type="textbox" size="10">
    <input type="submit" value="submit">
    </form>
    </BODY>
    </HTML>
    ShowParameters.java
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    public class ShowParameters extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println( "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=CENTER>" + "</H1>\n" +
    "<TABLE BORDER=1 ALIGN=CENTER>\n" +
    "<TR BGCOLOR=\"#FFAD00\">\n" +
    "<TH>Parameter Name<TH>Parameter Value(s)");
    Enumeration paramNames = request.getParameterNames();
    while(paramNames.hasMoreElements()) {
    String paramName = (String)paramNames.nextElement();
    out.println("<TR><TD>" + paramName + "\n<TD>");
    String[] paramValues = request.getParameterValues(paramName);
    if (paramValues.length == 1) {
    String paramValue = paramValues[0];
    if (paramValue.length() == 0)
    out.print("<I>No Value</I>");
    else
    out.print(paramValue);
    } else {
    out.println("<UL>");
    for(int i=0; i<paramValues.length; i++) {
    out.println("><LI>" + paramValues);
    out.println("</UL>");
    out.println("</TABLE>\n</BODY></HTML>");
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    doGet(request, response);
    example.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/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Welcome </display-name>
    <description>
    Welcome to Pc Tune Up
    </description>
    <servlet>
    <servlet-name>example.ShowParameters</servlet-name>
    <servlet-class>example.ShowParameters</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>example.ShowParameters</servlet-name>
    <url-pattern>/Example.html</url-pattern>
    </servlet-mapping>
    </web-app>
    and the servlet is sucessfully compiled..
    and i put the classes in the ROOT directory..
    The structure is as follows:
    C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\classes\example\ShowParameters.class
    and also the java files in the same folder
    and i created the jar file and placed it in the lib folder of ROOT.
    but when i am trying to run the html file and submit the form it says HTTP:404 FILE NOT FOUND ERROR..
    Can anyone please help me where i am going wrong....
    Thanks & Regards
    Lavanya

    [<form action="\example\classes.ShowParameters" method="post">[
    this is wrong
    change it to
    <form action="/Example.html" method="post">
    beacause you have specified
    <url-pattern>/Example.html</url-pattern>
    this is how you map a request to a servlet
    its better if you chage it like this
    <form action="/Example." method="post">
    In web.xml
    <url-pattern>/Example</url-pattern>

  • Cannot Import javax.servlet.* and javax.servlet.http.*

    Hello,
    I am a University Student and now doing a project using Servlet and JSP
    I have installed WinXP and Tomcat 5.0 on my computer
    When I compile the servlet , there are error messages "package javax.servlet does not exist" and "package javax.servlet.http does not exist" coming out.
    I have set the classpath already
    i.e. %CATALINA_HOME%\common\lib\servlet-api.jar;%CATALINA_HOME%\common\lib\jsp-api.jar
    ( Of course "%CATALINA_HOME%" = my folder that install the Tomcat )
    Can Anybody Explain what is happening and suggest a solution to me?
    Please give a hand.

    When you ran that command, what happened? Let javac.exe tell you the right answer.
    I'd advise two things:
    (1) Installing any s'ware in a directory whose name contains spaces (e.g., "Apache Software Foundation" or "Tomcat 5.0") is a very bad idea, IMO. I'd reinstall to a new directory.
    (2) Your HelloServlet.java servlet probably doesn't have a package statement in it. Tomcat 5.0 won't play nicely with servlets or beans that aren't in packages. I'd add one and use the -d . option on javac.exe to make sure it created the package directory structure for me.

Maybe you are looking for

  • Photoshop Elements and Windows Live Mail :(

    Had Adobe come out with a patch yet to fix their oversight regarding WLM?  Windows 7 had WLM and you can't get PE to send photos to WLM.  It's very disappointing.  I hate to abandon my favorite photo email software for something that works......  but

  • Changing numerical values in any object not working correctly

    I'm trying to create new parts and I want to adjust things like hole diameter, body length, offset height. When I go to change the numerical values......I highlight the numbers and start typing my new value and it just adds random numbers to the fiel

  • My i5 won't send MMS messages.

    Whenever I try to send an MMS it says cannot send message. "MMS messaging needs to be enabled to send this message".  I have enabled imessage  and send as SMS also.

  • Change screen name

    please tell me how to change my screen name. it doesnt seem possible in my settings. thanks. This question was solved. View Solution.

  • Error when creating delivery referenced by STO doc. from vl10b

    Hi All, We are getting an error when creating delivery as background from vl10b t-code referenced by STO. The error message " Global official numbering: Input parameter incomplete " . Please give me a hand for this problem. Thanks in advance for your