Getting error 404 when iam running a simple login servlet in tomcat

hi
this is my Login.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class Login extends HttpServlet
     public void doPost(HttpServletRequest rq, HttpServletResponse rs)
          String username =rq.getParameter("username");
          String password =rq.getParameter("password");
try{
          rs.setContentType("text/html");
          PrintWriter out=rs.getWriter();
          out.println("<html><body>");
          out.println("thank u, " + username + "you r logged sucessfully");
          out.println("</body></html>");
          out.close();
          }catch(Exception e){
               e.printStackTrace();
i have saved in the form ofC:\Program Files\apache-tomcat-4.1\webapps\sravan\WEB-INF\classes\Login.class
where sravan is my folder
step 2: Login.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>login page</title></head>
<body>
<h1> WELCOME TO THE SERVLET HOME PAGE</h1>
ENTER UR USERNAME AND PASSWORD
<form action="/sravan/Login" method="Post">
     username<input type="text" name="username" >
     password<input type="password" name="password" >
     <input type="submit" value="submit"></form>
     </body>
</html>
i have saved in the form C:\Program Files\apache-tomcat-4.1\webapps\sravan\Login.html
step3:
my 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/dtd/web-app_2_3.dtd">
<web-app>
<display-name>beginning j2ee</display-name>
<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>Login</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>Login</url-pattern>
</servlet-mapping>
</web-app>
i have saved in C:\Program Files\apache-tomcat-4.1\webapps\sravan\WEB-INF\web.xml
step4:
here is my server.xml
<Context path="/sravan" docBase="sravan" debug="0" reloadable="true" privileged="true"/>
saved in C:\Program Files\apache-tomcat-4.1\webapps\sravan\WEB-INF\server.xml
everything is fine....program is compiled ...but when iam running the servlet in tomcat iam getting error 404 Login.html not found....
so plz kindly help me this my first servlet .....

There seems not to be any '.html' in your url-pattern
<url-pattern>Login</url-pattern>- so i presume you should use
http://yourhost/Logininstead.

Similar Messages

  • Why do I get Error: 404 when I try to download a Lightroom upgrade on the UK site?

    Why do I get Error: 404 when I try to download a Lightroom upgrade on the UK site?

    Try downloading from below link :
    New Adobe Lightroom 6 (CC) Direct Download Links – Free Trials | ProDesignTools
    Feel free to post , if you need further assistance

  • I cannot sign in.  I get error "404" when I try, then it takes me to a "Fill and Sign" page. Not to Export page

    I cannot sign in.  I get error "404" when I try, then it takes me to a "Fill and Sign" page. Not to Export page.  At that point, there are no options to do anything else.

    It seems to have started to work now... so who knows.

  • HT4623 iam getting Error -1 when iam restoring using itune

    iam getting Error -1 when iam restoring using itune

    Hi LordZc,
    Thanks for visiting Apple Support Communities.
    You can find more information about iTunes restore errors in this article:
    Resolve specific iTunes update and restore errors
    http://support.apple.com/kb/TS3694
    This information relates to error 1:
    Check for hardware issues
    Try to restore your iOS device two more times while connected with a cable, computer, and network you know are good. Also, confirm your security software and settings are allowing communication between your device and update servers. If you still see the alert when you update or restore, contact Apple support.
    Common errors: 1, 10-47, 1002, 1011, 1012, 1014, 1000-1020.
    Since you have already tried to restore more than two times, I recommend checking for issues between iTunes and security software using the steps in the article below:
    Resolve issues between iTunes and security software
    http://support.apple.com/kb/TS3125
    After doing so, see this article for the steps to restore when your device is in recovery mode:
    iOS: Unable to update or restore
    http://support.apple.com/kb/ht1808
    Best Regards,
    Jeremy

  • SSRS 2008 Created Commssion Report, now getting error message when I run this ( need Help)

    in SSRS 2008 2 years ago created Commission with sub reports added, it was working fine, some how started to get error  
    message when we entered some invoice # see below screen shot of error message
    but same time if I enter different invoice # it process the report without any error message , donot understand the problem
    what's causing this issue, I have looked each sub report,
    can some one suggest any idea,
    I have spent hrs to figure it out, no luck so far.
    thanks in advance
    see the 2nd screen shot with report process
    any help will be greatly appreciated

    Hi Wendy
    thanks for your reply
    I tried creating new report , I have 1 main report and 3 sub report on this
    on main report when I enter some invoice# and accountnum  data shows up with no problem,
    but same time if I enter different invoice# and accountnum , there is no data return  on same query, I have checked my query so many times, donot understand this issue, what's causing this problem, since all the data pulling from same tables, why its
    not pulling for some invoices,
     other strange thing , I created this report , year ago, there was no problem until now,
    all of the sudden this problem just shows up,'
    I am not that expert in sql , can I really use advise
    see below by query , if you can tell me what's wrong with my query I will be really greatfull I have spend so much time to figure it out, but so far no luck
    SELECT        VENDTRANS.DATAAREAID, SALESTABLE.SALESID, VENDTRANS.VOUCHER, SALESTABLE.SALESTYPE, SALESTABLE.SALESSTATUS, VENDTRANS.TRANSDATE,
                             CUSTINVOICEJOUR.INVOICEAMOUNT, VENDTRANS.INVOICE, VENDTRANS.PAYMMODE, VENDTRANS.ACCOUNTNUM, VENDTRANS.TRANSTYPE,
                             VENDTRANS.LASTSETTLEVOUCHER, VENDTRANS.TXT, CUSTINVOICEJOUR.INVOICEACCOUNT, CUSTINVOICEJOUR.INVOICINGNAME,
                             VENDTRANS.LASTSETTLEDATE, LEDGERJOURNALTRANS.ACCOUNTTYPE, LEDGERJOURNALTRANS.AMOUNTCURCREDIT, LEDGERJOURNALTRANS.LINENUM,
                             CUSTINVOICETRANS.INVOICEDATE
    FROM            SALESTABLE INNER JOIN
                             CUSTINVOICETRANS ON SALESTABLE.DATAAREAID = CUSTINVOICETRANS.DATAAREAID AND SALESTABLE.SALESID = CUSTINVOICETRANS.SALESID
    INNER JOIN
                             CUSTINVOICEJOUR ON CUSTINVOICETRANS.INVOICEID = CUSTINVOICEJOUR.INVOICEID AND CUSTINVOICETRANS.SALESID = CUSTINVOICEJOUR.SALESID
    AND
                             CUSTINVOICETRANS.INVOICEDATE = CUSTINVOICEJOUR.INVOICEDATE INNER JOIN
                             VENDTRANS ON CUSTINVOICETRANS.INVOICEID = VENDTRANS.INVOICE AND CUSTINVOICETRANS.DATAAREAID = VENDTRANS.DATAAREAID
    AND
                             CUSTINVOICEJOUR.DATAAREAID = VENDTRANS.DATAAREAID AND CUSTINVOICEJOUR.INVOICEDATE = VENDTRANS.TRANSDATE INNER JOIN
                             LEDGERJOURNALTRANS ON VENDTRANS.DATAAREAID = LEDGERJOURNALTRANS.DATAAREAID AND
                             VENDTRANS.ACCOUNTNUM = LEDGERJOURNALTRANS.ACCOUNTNUM AND CUSTINVOICETRANS.LINENUM = LEDGERJOURNALTRANS.LINENUM AND
                             VENDTRANS.INVOICE = LEDGERJOURNALTRANS.INVOICE AND VENDTRANS.VOUCHER = LEDGERJOURNALTRANS.VOUCHER AND
                             VENDTRANS.PAYMMODE = LEDGERJOURNALTRANS.PAYMMODE AND VENDTRANS.TRANSDATE = LEDGERJOURNALTRANS.TRANSDATE
    WHERE        (VENDTRANS.DATAAREAID = N'AR1') AND (SALESTABLE.SALESTYPE = 3) AND (SALESTABLE.SALESSTATUS = 3) AND (VENDTRANS.ACCOUNTNUM = @Accountnum)
                             AND (VENDTRANS.INVOICE = @Invoice) AND (LEDGERJOURNALTRANS.ACCOUNTTYPE = 2)

  • Why do I keep getting Error 1000 When I run Abort VI Method?

    Need to know how to get this to work

    Hitman,
    Here is a KnowledgeBase that discusses the issue.
    Why Do I Get Error 1000 When Attempting to Abort a VI Through VI Server?
    Evan
    National Instruments

  • Getting Error 404 when trying to open php documents in DW CS3 Test server

    I am new to DW, php, MySQL and Apache. I have set up a test
    environment but obviously have done something wrong. I currently
    create my web pages from scratch in notepad and update my site with
    a GUI FTP program, but I know with these new tools, I will
    eventually be able to create the type of web site that I really
    want and need. Every time I try to open any php document in DW CS3
    using the"Preview/Debug in browser" button I get an error 404. The
    browsers I use are ie7.0.5730.11 and Nav 9.0b2 . I know this may
    not even be a DW issue, but I really am at an impasse. Any help
    would be much appreciated.

    Jharek Wolf wrote:
    > As I previously mentioned I am new to Apache also. Are
    you willing to
    > continue helping me?
    It sounds as though you need to be taken through this process
    step by
    step. Even though you say you defined a testing server, the
    fact that
    you didn't have your documents in the server's document root
    suggests
    your site definition might also be wrong.
    First things first. Since you're new to Apache, what happens
    when you
    type
    http://localhost/ into your browser
    address bar? Depending on the
    version of Apache, you should get an Apache test page or
    simply a page
    that says "It works!". If you get neither, it means Apache is
    either not
    running or that it has been incorrectly installed.
    Assuming Apache is working, have you installed PHP? If so,
    put the
    following code into a blank file (there must be no HTML or
    DOCTYPE -
    just the following line):
    <?php phpinfo(); ?>
    Save the file as test.php in the Apache document root. Then
    type
    http://localhost/test.php into
    your browser address bar. If you see a
    page with masses of detail about your PHP configuration, PHP
    is working.
    You can then move to the final stage. Create a new folder
    inside the
    Apache document root. This is where you should store your
    site. If you
    call it "mysite", these are the settings you need in the
    Testing server
    definition:
    Testing server folder: /path/to/htdocs/mysite/
    URL prefix:
    http://localhost/mysite/
    Don't take "/path/to/htdocs/mysite/" literally. It indicates
    the
    location of htdocs/mysite on your local hard drive. Use the
    folder icon
    to the right of the Testing server folder field to navigate
    to it.
    If you're new to PHP, you might find that my book, "The
    Essential Guide
    to Dreamweaver CS3 with CSS, Ajax, and PHP" answers a lot of
    your
    questions. It covers all the Dreamweaver PHP server behaviors
    in detail,
    as well as teaching the basics of PHP and database
    maintenance. You can
    find more details by following the link in my sig.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Why i get error msg when i run my program? (java.lang.NoClassDefFoundError)

    i have compile and run my program. First time the program can run. But after that when i run, come out error messege as below:
    java.lang.NoClassDefFoundError: FormPoster (wrong name: search/FormPoster)
    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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    Exception in thread "main"
    what can i do? thank very much

    Hello,
    i have compile and run my program. First time theprogram can run.
    But after that when i run, come out error messegeas below:
    java.lang.NoClassDefFoundError: FormPoster (wrongname: search/FormPoster)
    Check your FormPoster class: the classname has to be
    the same as
    the file name and the class should be stored in its
    correct directory
    (the sub directory structure should reflect the
    package name).
    kind regards,
    JosYou should also check your clsspath if you are using packages.

  • How can I get my yahoo mail back? I just get error 404 when I try to open my mail when I am on Firefox.

    The only thing I can add to this question is that I can get on my yahoo mail through internet explorer

    Set Yahoo as you home page, and set firefox to open the homepage when it starts. (Not to open previous pages).
    * see [[how to set the home page]] for detailed instructions <br/> all you need to do is drag the icon whilst you are on the page you require
    * see also [[options window - General panel]]

  • I get this message when trying to past simple text into an e-mail document. The Web-Based Email plugin has crashed. I have run out of options...please help.

    The Web-Based Email plugin has crashed. I get this message when trying to paste simple text into an email document. I have updated plugins and have run out of options. If I use another browser I have no problem. Please advise.

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • Get these two error messages when I run the iTunes exe file:  Error 2 and Error 2 (Windows error 2).  Both say Apple Application Support is required.  Uninstalled and tried to install again several times.  Using Windows 7 64 bit on laptop.

    Trying to install iTunes on my Dell laptop with Windows 7 - 64 bit.  Get these two error messages when I run the iTunes exe file:  Error 2 and Error 2 (Windows error 2).  Both say Apple Application Support was not found.  Can anyone tell me why this is happening?

    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • I KEEP GETTING ERROR -3 WHEN INSTALLING THEN ERROR -2093 WHEN I TRY TO RUN

    I KEEP GETTING ERROR -3 WHEN INSTALLING QUICK TIME, AND THEN WHEN I TRY TO RUN ITUNES I GET ERROR -2093. PLEASE HELP!! I HAVE DELETED AND REINSTALLED THIS MORE THAN 5 TIMES ALREADY! I HAVE AN ACER COMPUTER WITH WINDOWS XP. IF YOU CAN HELP ME PLEASE REPLY OR WRITE ME AT [email protected]

    Hi DaFudgeWizzad57392483,
    Please refer to the threads below where this issue has been addressed:
    1. Installing Creative Cloud-Error 205
    2. Creative Cloud Error 205
    3. Creative Cloud App, installation error code 205
    Regards,
    Sheena

  • I am getting error messages when importing CD's. I keep getting a message saying 'unable to connect to CDDB server'. I run itunes on a macbook pro. Any ideas/solutions?

    I am getting error messages when importing CD's. I keep getting a message saying 'unable to connect to CDDB server'. I run itunes on a macbook pro. Any ideas/solutions?

    Don't worry I've sorted it! I just had to turn off Reminders as well in iCloud. Calendar then worked fine, even when I turned Calendar and Reminders back on.

  • Why all of a sudden am I having difficulty sending Gmail emails? I get a send error. When I run diagnostics there is a SMTP and IMAP account for Gmail and I am not sure how to fix this.

    Why all of a sudden am I having difficulty sending Gmail emails? I get a send error. When I run diagnostics there is a SMTP and IMAP account for Gmail and I am not sure how to fix this.

    Hi jodilynnf,
    When using Connection Doctor to see what is could be causing the issue, look for the red dots to let you know what is wrong. Then all you have to do is correct that information. You can double click on the section that is giving you issue and it will take you there. Most issues could be just password being entered incorrectly. Take a look at the article below to walk you through troubleshooting issues with Mail.
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/en-us/TS3276
     Take it easy,
    -Norm G.

  • I'm getting an "error 404" when I try to connect to a webinar - does anyone know what this means?

    I'm getting an "error 404" when I try and connect to a webinar - does anyone know what this means?

    Basically, it means that either the link you have is bad or the Connect server you are trying to connect to is down or inaccessible.
    HTTP 404 - Wikipedia, the free encyclopedia

Maybe you are looking for

  • JavaFX 2.0 : How to make a stage fit into browser view area?

    Invoking a JavaFX 2.0 applet from browser results in white spaces on the right and bottom area of the browser. This happens when the JavaFX stage resolutions is lesser than that of browsing desktop resolution. In a client/server model, usually server

  • Duplicated playlists

    Why are my playlists duplicated six times? Can I delete them without wiping out my original set of playlists?

  • Business Catalyst Help | Connect to your site using SFTP

    This question was posted in response to the following article: http://helpx.adobe.com/business-catalyst/partner/connecting-site-using-ftp-client.html

  • File Adapter 3.0

    In my scenario File -> XI -> R3 The file is being read and converted to xml <?xml version="1.0" encoding="utf-8" ?> <ns:FileType1 xmlns:ns="http://test.com"> <ns:FileType1 xmlns:ns="http://test.com"> <FileType1>    <type>1</type>    <name>23</name>  

  • SQL Server slow on some records after insert

    Have an application that uses Web Service which picks packages with 250 records on the server. Each item is validated and inserted into the database. The problem is that with an empty table, the process inserts 20 records per second, although I still