-2

I am trying to develop a very simple web app in Eclipse using tomcat as the web container. My problem is that when i type localhost:8080 in the browser it comes up with the tomcat web page, so it works. But when I try to run my servlet on server through Eclipse i get the 404 error saying that the requested resource is not available. My index.html works without problems but when I click on button to compile my servlet I get the 404 error.Please help me solving this problem. Here attached the index.html and login.java text. Sorry, I'm Italian so part of the text are written in Italian but you should be able to understand anyway.

<!DOCTYPE html> <html> <head>
    <meta charset="UTF-8">
    <title>Pagina iniziale del sito</title> </head> <body>
    <h1>Benvenuto</h1>
    <p>Effettua il login per accedere</p>
    <form action="login" method="post">
        Username: <input name="user" type="text" /><br />
        Password: <input name="pass" type="password" /><br />
        <input type="submit" value="Login" />
    </form> 
</body> </html>
2
  • <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Pagina iniziale del sito</title> </head> <body> <h1>Benvenuto</h1> <p>Effettua il login per accedere</p> <form action="login" method="post"> Username: <input name="user" type="text" /><br /> Password: <input name="pass" type="password" /><br /> <input type="submit" value="Login" /> </form> </body> </html> Dec 2, 2014 at 18:45
  • 1
    Would you please add your web config? It could be that you did not properly configure the servlet.
    – Virmundi
    Dec 2, 2014 at 18:48

1 Answer 1

0

Add your webapp to Tomcat, to do that, right click Tomcat and then "Add and Remove...". If you already do that, try Tomcat>Clean.... The webapp should be access with

http://localhost:8080/your_project_name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.