This project is created to guide & train the individual, who are beginner on Servlet & JSP. It is build on Eclipse-Oxygen-M2 release. The exercise questions are taken from the lab assignment of Server Side Programming, BSc.IT, Fourth Semester, Lord Buddha Education Foundation.
First try to solve the exercise at your own. And, if you get stuck in any problem, see the solution without wasting your time. Follow me & stay connected to get my upcoming guides & tutorials.
Happy Coding!! 😊😊
Clone or download the repo. Move the repo folder to your Eclipse's Workspace. And, see Importing Existing Project in Eclipse.
Clone or download the repo. And, see Importing Eclipse Project in NetBeans.
- Write a Servlet program to display welcome message in browser using web.xml to map the Servlet.
- Design an HTML form to invoke a Servlet which should catch registrationNo, firstname and lastname from the client side and display the same to client side in HTML format.
- Write a Servlet program to demonstrate the use of HttpServletRequest’s and HttpServletResponse’s methods to display header information.
- Make a form to input the details of students like regno, first name, last name, phone, education and email and, display all the input values from Servlet by using Enumeration class.
- Write a Servlet program to insert a record into the database and display “Record inserted.” if record is inserted successfully or “Can't insert a record.” message if unsuccessful. The database is “EmpDb”, table name is “employee” and fields are empno, name, designation, phone.
- Create a Servlet program to store product's details and facilitate to query the specific product.
- Write an Servlet program to insert a record having fields employeecode, firstname, lastname and email in "employee" table. Assume that database name is “ABC” in MySQL.
- Create a form in HTML to accept the marks of the students in different subjects and store into the table named "marks" of database named "Student" in MySQL.
- Write a Servlet program to connect to database and display the records of "registration" table of "student" database.
- Write a Servlet program to display digital clock in browser.
- Write a Servlet program to redirect the url by using sendRedirect method and RequestDispatcher interface.
- Write a Servlet program to demonstrate the redirection by using two methods include and forward.
- Write a Servlet program to demonstrate the use of setAttribute and getAttribute methods.
- Write a Servlet program to demonstrate Exception Handling using the deployment descriptor (i.e. web.xml).
- Write a Servlet program to demonstrate Exception Handling using RequestDispatcher.
- Write a Servlet program to log the exception by using log method.
- Write a Servlet program to handle session by using HttpSession interface.
- Write a Servlet program to write a cookie in user's computer. Cookie name should be "sessionid" and cookie value should be session's id.
- Write a Servlet program to retrieve the cookie from user's computer and display name and value of it.
- Write a Servlet program to track the session using URL rewriting.
- Write a session tracking program in Servlet by using Hidden Form Fields.
- Write a program to read and display the Servlet's initial parameter from web.xml.
- Write a JSP program to welcome the user with the welcome message.
- Write a JSP program to demonstrate the declaration, scriplets and expressions.
- Write a JSP program to demonstrate the setAttribute and getAttribute method.
- Write a JSP program to demonstrate the use of JSP Page directives.
- Write a JSP program to demonstrate the use of JSP file inclusions.
- Write a JSP program to pass a parameter from one jsp file to another and display the values.
- Create an HTML form to accept the login name and password, check the authorized login name and password through JSP at the server side and display appropriate message.
- Write a Servlet program to demonstrate HTTP Basic Authentication. Add super user as administrator in tomcat-users.xml to maintain database record of users and their roles.