WTAD Practical

WTAD Practical Solutions

Semester: IV

Subject Name: Programming Skills – VII (WTAD)
Subject Code: 2640012


Extra Programs related with WTAD

GTU Practical Program List Solutions


1.  Write a JavaScript that shows how a variable’s typecan be changed on-the-fly.


2.  Write a JavaScript that demonstrates the use of +=,-=,*=,/= operators.


3.  Create a Form in HTML with two fields, minimum and maximum, write JavaScript to validate that only numeric value is entered in both, and the value entered in minimum is less than the value entered in maximum.


4.  Write a JavaScript that finds out multiples of 10 in 0 to 10000. On the click of button start the timer and stop the counter after 10 seconds. Display on the screen how many multiples of 10 are found out within stipulated time.


5.  Write a JavaScript to generate two random numbers and find out maximum and minimum out of it.


6.  Write a JavaScript to remove the highest element from the array and arrange the array in ascending order.


7.  Write a JavaScript to convert Celsius to Fahrenheit.


8.  Write a JavaScript to find a string from the given  text. If the match is found then replace it with another string.


9.  Write a JavaScript to show a pop up window with a message Hello and background color lime and with solid black border.


10.  Write a Servlet to display “Hello World” on browser.


11.  Write a Servlet to display all the headers available from request.


12.  Write a Servlet to display parameters available on request.


13.  Write a Servlet to display all the attributes available from request and context.


14.  Write a Servlet which displays a message and also displays how many times the message has been displayed (how many times the pagehas been visited).


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


19.  Write a simple JSP page to display a simple message(It may be a simple html page).


20.  Write a JSP page, which uses the include directive to show its header and footer.


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>).


27.  You want to reduce the amount of Java coding in your JSP using a JavaBean component. (Hint:  Use <jsp:useBean> with the name of your bean).


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
EmpId Integer
Empname Varchar
Emp_desig Varchar
Emp_J_Date Varchar
Emp_Salary Numeric


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.