Ok, after searching the archives for the word "cookie" I couldn't find an answer to this one. I've created two jsp pages and am using the Request 1.0 taglib. Here's a sample of the code that works:
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://jakarta.apache.org/taglibs/request-1.0" prefix="req" %> <%@ taglib uri="http://jakarta.apache.org/taglibs/response-1.0" prefix="res" %> <req:request id="myReq"/> <res:addCookie name="foo" value="bar"/> <req:cookies id="myCookie" name="foo"> <c:set var="myCookieValue" value="${myCookie.value}"/> <jsp:getProperty name="myCookie" property="value"/> </req:cookies> <p>cookie Foo: ${cookie['foo'].value} <br>myCookieValue: ${myCookieValue} There are extra declared taglibs, because my production page has more code in it. Here's the page that doesn't work: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://jakarta.apache.org/taglibs/request-1.0" prefix="req" %> <%@ taglib uri="http://jakarta.apache.org/taglibs/response-1.0" prefix="res" %> <req:request id="myReq"/> <res:addCookie name="foo" value="bar"/> <%-- retrieve some information from a database--%> <sql:query dataSource="" var="stuff"> [sql query...] </sql:query> <c:forEach items="${stuff.rows}" var="myStuff"> <c:set var="myhcpollID" value="${myStuff.ds}"/> </c:forEach> <%-- Save a cookie on the user's machine. --%> <res:addCookie name="test" value="This."/> <res:addCookie name="listOfStuff" maxAge="-1"> <res:value>foo,bar</res:value> </res:addCookie> <%-- now try to get the cookie out, this probably only happens after a refresh, which is just fine. I want to move the setting of the cookie to after this point as soon as I get it working. --%> <req:cookies id="myCookie" name="listOfStuff"> <c:set var="idList" value="${myCookie.value}"/> <jsp:getProperty name="myCookie" property="value"/> </req:cookies> <p>IDList: ${idList} <%-- Save some information to the database. --%> <sql:update dataSource="${applicationScope.ds}"> INSERT INTO [sql code....] </sql:update> <res:isCommitted> <p>The response has been committed. </res:isCommitted> Ok, at this point the "The response has been committed." is not printing out, which indicates to me that it is still ok to write cookies. The first time through the page, it is ok if there is no cookie retrieved in the request. In other words, even though I am retrieving the same cookie later on in the page, I don't expect it to be there the first time through. However, the second time through -- after refreshing the page -- I expect the cookie to be there and none of the three cookies are set. The first example, which is stripped down quite a bit, works just fine. The second does not. Any help on this would be appreciated. I've read through the documentation for the tag a couple times and didn't see any potential problems. I'm probably just missing something simple. TIA. Thanks! Derek ===== __________________________________ Do you Yahoo!? Yahoo! Movies - Buy advance tickets for 'Shrek 2' http://movies.yahoo.com/showtimes/movie?mid=1808405861 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]