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:

<% Cookie killCookie = new Cookie(“Ck”, null); KillCookie.setPath(“/”); killCookie.setMaxAge(0); response.addCookie(killCookie); %>

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. Read more...
You might also like:

* Java Server Pages (JSP) in breif
* Struts and JSP
* JSP Tags

No comments:

Post a Comment