Note that the setRequest() machinery in 0.92 was removed in JSP 1.0.
You can use a custom Tag, though. Just need to define a doStartTag() or
doEndTag() method that operates on the pageContext.
Hope this helps,
- eduard/o
================
You can also write a bean that will handle the cookie stuff if you
want to hide the details from page authors:
----------------------------------------
package com.canetoad;
import javax.servlet.http.*;
import java.util.Hashtable;
public class CookieBean {
private Hashtable cookies;
public CookieBean() {
cookies = new Hashtable();
}
public void setRequest(HttpServletRequest request) {
Cookie _cookies[] = request.getCookies();
for(int i=0;i<_cookies.length;i++) {
cookies.put(_cookies[i].getName(),_cookies[i]);
}
}
public String getCookieValue(String name) {
Cookie tmp = (Cookie) cookies.get(name);
if(tmp != null) return tmp.getValue();
return null;
}
public String getMyCookie() {
return getCookieValue("myCookie");
}
}
----------------------------------------
You could also write similar accessors to get the domain, comments, max
age, etc.
In your JSP you could then do:
<jsp:useBean id="cookies" class="com.canetoad.CookieBean"/>
<jsp:setProperty name="cookies" property="request"
value="<%= request %>"/>
<P>
Your cookie named myCookie has the value:
<jsp:getProperty name="cookies" property="myCookie"/>
</P>
- Larne
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html