Cookie
We can use this implicit object to retrieve cookies associated with the request.
Example :${cookie.JSESSIONID}
${cookie.JSESSIONID.name}
${cooke.JSESSIONID.value}
test.jsp
<%@ page isELIgnored="false" %> <% Cookie cookie = new Cookie ("username","chamu"); cookie.setMaxAge(60 * 60); response.addCookie(cookie); %> <table border= 2> <tr><td><h2>${cookie.username.name}</h2></td> <td><h2>${cookie.username.value}</h2></td></tr> <tr><td><h2>${cookie.JSESSIONID.name}</h2></td> <td><h2>${cookie.JSESSIONID.value}</h2></td></tr> </table> |
First Request:
No comments:
Post a Comment