Spring 2023 - CS311 - 2
Spring 2023 - CS311 - 2
02
Total Marks: 20
Semester: Spring 2023
Topics Covered: 190-214
Introduction to Web Services Development – CS311 Due Date: 13th July, 2023
Instructions:
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
Objectives:
To understand and get hands on experience of:
HTML
Servlet
You can run and check your complete code in any tool but after that copy/paste your code in
word format (.doc or docx) to upload.
Problem Statement: Marks 20
Write the code for two Java Servlets (processRequest() methods only) in such a way that the user
enters his/her title(Mr, Mrs, Miss), first name and last name and submits the form to the FirstServlet.
FirstServlet concatenates the first name with first and last name with proper space and forwards the
request (using the Request Dispatcher method) to SecondServlet, which displays the full name of the
user.
Note: No need to send complete code, just send the code in processRequest() method of each Servlet,
as shown below.
Solution Sample:
request.setAttribute("fullName", fullName);
dispatcher.forward(request, response);
}
SecondServlet processRequest() method:
response.setContentType("text/html");
out.println("<html>");
out.println("<body>");
out.println("</body>");
out.println("</html>");
BEST OF LUCK