Experiment 4 Problem Statement
- Write programs in Java using Servlets:
- To invoke servlets from HTML forms
- Session tracking using hidden form fields and Session tracking for a hit count
Invoking Servlets from HTML Forms
AIM
To write a Java Servlet program to invoke HTTP servlets from the HTML forms.
ALGORITHM
- Create a new project(Java Web) in Netbeans IDE.
- Create a new servlet by clicking on file->new->servlet.
- Call the HTTP servlet program inside the index.html page using form tag.
- Run the program and display the details entered in the HTML form in new HTML page using servlets.
Program
Experiment 4 - Invoke Java Servlets from HTML FormsSession Tracking using Hidden Form Fields
AIM
To write a JAVA Servlet program for session tracking using hidden form fields.
ALGORITHM
- Create a HTML form with hidden input type field.
- Create a Servlet Page which reads all the values from the HTML form including hidden input field.
- Display the form details in the new HTML page.