|
|
10 - Practical session October 12, 2006 - lecture by Angela Fogarolli
Exercise on Servlet
- 1. step:
- create a jsp page that takes in input a string (ex. product name);
- create a servlet that puts the string input in a shopping cart(Session variable).
- 2. step:
- create a jsp page that shows the content of the shopping cart.
- 3. step:
- create a login filter. The filter should be applied to all pages. The filter should check if the user is already logged or not (checking a Session variable)
Alternatives
- a) if the user is not logged write a debug information ("user not logged") and do the login writing the Session variable..
- b) If the user is not logged redirect the request to a login page.
|
Solution Solution provided by Alessandro Bertacco |
|
|