How to make a simple Login page using Servlet & Session in NetBeans IDE

Published: 10 August 2013
on channel: raksrahul
101,449
174

How to make a simple Login page using Servlet & Session in NetBeans IDE

1. Open NetBeans IDE

2. Make a new Project as:

2.1 File~NewProject~Java Web~WebApplication

3. Make a servlet(say First.java) as:

3.1 RightClick on Source Package~New~Other~Web~Servlet
3.2 Name your Servlet
3.3 Check Add Information to deployment descriptor(web.xml file)

4. Make another servlet(say Second.java).

5. Make an HTML file as:

5.1 RC on Web Pages folder and select New~Other~Web~HTML
5.2 Design a simple form in HTML
5.3 Give the url-pattern of First Servlet in the 'action' attribute(say '/First')

6. Write code for First.java to authenticate the user

6.1 In this servlet set the session attribute with a 'key' and its 'value'.

7. Write code for Second.java to view the profile

7.1 In this get the attribute of session.

8. Run the Project(let server is Tomcat).

9. Finish.

Follow us on :
Facebook :   / raksrahul-100219708647780  
Instagram :   / raksrahul_ig  


Watch video How to make a simple Login page using Servlet & Session in NetBeans IDE online without registration, duration hours minute second in high quality. This video was added by user raksrahul 10 August 2013, don't forget to share it with your friends and acquaintances, it has been viewed on our site 101,449 once and liked it 174 people.