Get all updates of Java4s
Follow Us: Email Newsletter

Java Servlet login Example In Eclipse

Servlets »on Jan 19, 2013 { 14 Comments } By Sivateja

Let us discuss one simple login application using servlet and jsp, friends please refer previous articles if you still have any doubts regarding strvlets flow :-)

Directory Structure

Files Required

  • index.html
  • web.xml





You Might Also Like

  ♦ About Author ♦

Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.


14 Responses to “Java Servlet login Example In Eclipse”
  1. Sireesha says:

    Can you please talk about the tag welcome-file-list. How will the parameters defined under that tag be used. How will the webserver understand that the submit button on the index.html corresponds to the servlet-mapping LoginServlet with url pattern /login???

  2. Subair says:

    It is very helpful

  3. brijesh says:

    what are the benifits of servletconfig

  4. naresh says:

    .html file and .xml file url should same????

  5. huynh says:

    Login correct username and password but it’s redirect login failed

  6. Ankit Srivastava says:

    Can You explain the flow of this Program, how it works.

  7. akula says:

    Thanks you very much for explaning this concept,here one more thing i didn’t understand.i,e u didn’t used…
    will u pls explain this once.

  8. Aneeq Azam says:

    it is very helpful but I needed to check entered username and password is equal to param values entered in xml
    so If you update it with that it’ll be more helpful
    thanks alot

  9. Poornachander Kota says:

    It is easy to understand..

  10. Parameswari says:

    Could you pls explain the code flow.. Am getting HTTP 405 errorHTTP method GET is not supported by this URL. Thanks!!

  11. viswanath says:

    Could you please tell me what is the difference between servlet and webservice? and which is better?

    • mahesh says:

      servlet directly takes request from the end-user(browser) but webservice doesn't takes the request directly from the end-user & it takes the request from another servlet (or) any service.webservice is very important becoz it is interoperable(platform independent,language independent) & distributed……………

  12. avi says:

    nice and very helpful

  13. Chitharanjan says:

    Is there any jar files I need to add for executing this code.


By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful LinksCurrent & UpComing Tutorials
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2017 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.