|
Hi
Surya,
As you
know, javascript is executed on client side, against JSP(or Servlet) on server
side.
Then,
there is no way to add the value of a textfield to the cookie using JSP in one
session.
But if
you decide to use javascript to add the value to the cookie, you
can.
As a
reference, you can write JSP code that generates javascript code in JSP 1.0
spec.
ex)
<%@
page language=javascript %>
<%
... javascript code
...
%>
I
recommend for you to post the textfield value(using form/action) to JSP that
handles the value.
ex)
In page1.jsp
:
<form
action="/writecookie.jsp" method="post">
<input
type=text name="name1" size=20 value="">
</form>
In
writecookie.jsp
<%
String
value1 = request.getParameter("name1"); // getting the value
of textfield
Cookie cookie = new Cookie("name1", value1); // adding
cookie
cookie.setPath("/");
response.addCookie(cookie);
:
%>
I hope it
will help you.
from
acidzazz ^!^ -----Original Message----- From: Siva Surya Kumar V [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 23, 1999 12:56 PM To: acidzazz Subject: Re: Re: Writing cookie in jsp
|
- Writing cookie in jsp Mike Begeman
- Re: Writing cookie in jsp James & Sue Ann Birchfield
- Re: Writing cookie in jsp acidzazz
- Re: Writing cookie in jsp acidzazz
- Re: Writing cookie in jsp Praveen Kumar S .
- Re: Writing cookie in jsp acidzazz
- Re: Writing cookie in jsp Praveen Kumar S .
