3 - Test Your Knowledge - Optional Assignments

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

RequestDispatcher, SendRedirect and Servlet communication.

1. Age Calculation: Develop a web application which would take the date of birth from the html
form and then display the age in another sevlet.

2. What are the commonly used method in RequestDispatcher, please elaborate them along with
its functionality.

3. Create an application for Electricity board, which gets the number of units consumed by the
customer in a html form and calculates the bill amount based on the below slab rate, the bill
amount should be display using servlet. Also there should be a link called 'details' in the page
where the bill amount is displayed once the customer clicks on it the below slab details should
be displayed highlighting the slab in which the customer falls.

1 to 100 Rs. 5 per unit


101 to 300 Rs. 10 per unit
301 to 500 Rs. 15 per unit along with a surcharge of Rs.100
500 and above Rs. 25 per unit along with a surcharge of Rs.500

4. Design an application to create a billing system for a garment shop. HTML for should have
provision to enter item id, item description, price and quantity. Once the details are entered and
'generate bill' button is clicked user should be navigated to a page where the final bill amount is
calculated. If the total bill amount is above Rs.5000 then a discount coupon code should be
displayed along with the bill amount. Make use of include method for this purpose.

5. Create an application getting the customers name, address, phone and email after validating the
same allow them to access flipkart application.

6. Bring out the difference between servlet communication in different application and the one in
different servlets.

7. How is forward different from include and in which scenario/case do we use include and
forward.

8. When is it advisable to use sendRedirect and why. Could you give a real time example of
forward and sendRedirect and bring out their differences clearly.

TCS Internal

You might also like