WTAD Practical Solutions
GUJARAT TECHNOLOGICAL UNIVERSITY
MASTER OF COMPUTER APPLICATIONS (MCA)
Subject Name: Programming Skills – VII (WTAD)
Subject Code: 2640012
Extra Programs related with WTAD
- Servlet Configuration
- Java Servlet Database Configuration with Oracle
- Java Servlet Database Configuration with MySQL
GTU Practical Program List Solutions
15. Assume that we have got three pdf files for the MCA-1 Syllabus, MCA-2 Syllabus and MCA-3 Syllabus respectively, Now write a Servlet which displays the appropriate PDF file to the client, by looking at arequest parameter for the year (1, 2 or 3).
16. Assume that the information regarding the marks forall the subjects of a student in the last exam are available in a database, Develop a Servlet which takes the enrollment number of a student as a request parameter and displays the marksheet for the student.
17. Develop a Servlet which looks for cookies for username and password, and forwards to a home.jsp in case the cookies are valid and forwards to login.jsp, in case the cookies are not found or the cookies are not valid.
18. Develop a Servlet to authenticate a user, where theloginid and password are available as request parameters. In case the authentication is successful, it should setup a new session and store the user’s information in the session before forwarding to home.jsp, which displays the user’s information like full name, address, etc
21. Create a Java class called Product with the following properties: name, description, price. Create a listener that notifies (through System.out) whenever a user adds a product to a shopping cart (i.e. adds an object to the session object) or removes it again. Hint: check out the class HttpSessionAttributeListener. Make it print the name and price of the object (hint: access the session through the HttpBindingEvent object). Also, let the listener print the total price of all objects saved in the session so far (one way to accomplish this could be to keep a collection of all objects saved to the session – or just their keys – in the listener or an associated class).
22. Create a servlet filter that logs all access to andfrom servlets in an application and prints the following to System.out:
a. the time the request was received
b. the time the response was sent
c. how much time it took to process the request
d. the URL of the resource requested
e. the IP address of the visitor
23. Develop a interest calculation application in whichuser will provide all information in HTML form and that will be processed by servlet andresponse will be generated back to the user.
24. Develop an application to demonstrate how the client (browser) can remember the last time it visited a page and displays the duration oftime since its last visit. (Hint: use Cookie).
25. Develop an application to keep track of one user across several servlet invocations within the same browser session.
26. Develop an application to write a “page-composite” JSP that includes other pages or passes control to another page. (Hint: Use <jsp:include> or <jsp:forward>).
28. Develop a program to perform the database driven operation like insert, Delete, Update and select. To perform the above operations create one table named
Field NameField Type
29. Develop a Java application to perform the database driven operation like insert, Delete, Update and selection using PreparedStatement. To perform the above operations use the table from above exercise.
30. Write a Java application to invoke a stored procedure using a CallableStatement. For this a stored procedure called incrementSalary may be developed to increase all the employees salary by a percentage specified in the parameter.
31. Write a JSP page which uses tags availabe from the standard tag library JSTL.
32. Write a Servlet which uses the concept of Request forwarding & including external source in the current servlet context.
33. Develop a JSP Page to display the personal information and result information of the student in two different tabular formats.
34. Develop a JSP Page to perform database driven operations like insert, Delete, Update and selection with table named Student having fields like StudId, Name, Address, result.
35. Write a JSP Page to use JSP’s Page directives.
36. Write a JSP Page to use JSP scripting.
37. Write a JSP Page to which uses Session Tracking foronline shopping.