Use 'cookie' not 'name'

<logic:notPresent cookie="validUser">
         COOKIE Not FOUND<br>
        <!--jsp:forward page="/pages/error.jsp" /-->
</logic:notPresent>

Also, remember that you will be looking at the cookies in the request -- not any that have been set in the response.

One other thing, if you truly want to comment out JSP tags so they are not translated you must use the JSP comment markers (<%-- this will not be translated --%>).

- Bill Siggelkow

CCNY wrote:
Alright, I'm definitely in need of help now. I'm SURE I'm setting the
cookie in the response, but I cant get <logic:notPresent> to work as I
expect.

Help! What am I doing wrong?

-----------------JSP-------------
<logic:notPresent name="validUser"> COOKIE Not FOUND<br>
<!--jsp:forward page="/pages/error.jsp" /-->
</logic:notPresent>


------------JAVA in Action Class------------
if(authUser(userName,password)){
String cookieValue = new java.util.Date().toString();
System.out.println("Set cookie for "+userName+ " as "+cookieValue);
Cookie c = new Cookie ("validUser", cookieValue);
c.setMaxAge(3600*24); response.addCookie(c);
return (mapping.findForward("success"));
}else{
return (mapping.findForward("failure"));
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to