JSP Program to Delete a Cookie Values
JSP is a dynamic scripting capability for web pages that allows Java as well as a few special tags to be embedded into a web file (HTML/XML, etc). The suffix traditionally ends with .jsp to indicate to the web server that the file is a JSP files. JSP is a server side technology - you can’t do any client side validation with it. The JSP assists in making the HTML more functional. Servlets on the other hand allow outputting of HTML but it is a tedious process. It is easy to make a change and then let the JSP capability of the web server you are using deal with
compiling it into a servlet and running it.
Sample JSP Program to Delete a Cookie Value:
<%JSP pages are focused around HTML (or XML) with Java codes and JSP tags inside them. When a web server that has JSP support is asked for a JSP page, it checks to see if it has already compiled the page into a servlet. Thus, JSP pages become servlets and are transformed into pure Java and then compiled, loaded into the server and executed.
Cookie killCookie = new Cookie(“Ck”, null);
KillCookie.setPath(“/”);
killCookie.setMaxAge(0);
response.addCookie(killCookie);
%>
2 comments:
Thanks for the Great Info. It will be a great help in making out my sikat ang pinoy website
how to delete more the one cookie in jsp page.
help me.
Post a Comment