Search This Blog

part-1 servlet assignment question and solutions

cdac assignment dabc,desd,dac
1.) Write a Servlet to take name as request parameter from the user and display Welcome Page to the user with his name (with Get and Post HTTP methods).
2.) Write a Servlet with doGet method and extract all the request information along with the inputs given by the user in text field, radio button, checkbox and drop down menu.
3.) Create 2 HTML pages, one with GET method and one with POST method, with the action to the same Servlet. Handle both the requests using doGet and doPost methods.
4.) Write a Servlet to extract the multiple values sent with the request by the form with the same name.
5.) Write a Servlet class to extract names of the request headers, client’s browser information, cookies associated, the name of the HTTP method, remote port, local port, server port, content length. Justify the difference between Local Port and Server Port. Also use getIntHeader method and show how is it different from getHeader method.
6.) Write a Servlet class to download a file kept inside a folder within your application, on the request of the user. Take filename as input from the user and if file is not available show the appropriate message.
7.) Write a Servlet based query system, take query as input from the user in the textfield to extract the data from DataBase and display it to the user in tabular format.
8.) Write a Servlet program to redirect the request to some other page using sendRedirect method.
9.) Store email in DD as init-param name value pair. Write a Servlet to extract the initialization parameters inside the init method of your Servlet and display it within your service method.
10.) Write a Servlet program to override init method with ServletConfig parameter and repeat question (9).
11.) Write 3 Servlet classes and show one of them to the user based on the choice of the user taken as input by selecting Radio button.(You can use extra Servlet for logic part)
12.) In continuation to the above program,
a. ) Create a DD , store 3 parameter in the init param tag and one in the context param tag.
b. ) Display one out of 3 init params, on each of the servlet response based on some condition and context param with every response. Justify the difference between context param and init param.
13.) Write a Servlet Class to take empno as input from the user and update the salary of the user by calling the Stored Procedure and display the Updated Salary to the user.
for solutions please comment

3 comments: