On Friday 10 January 2003 05:49 pm, Brandon Rodak wrote:
> Paul,
>
> Here is a link to the Java - http://www.flex-internet.com/java.txt
>
> Thanks again for your help
>
> Brandon Rodak
> Web Services
> Computer Marketing Corporation
> http://www.cmcflex.com & http://www.flex-internet.com
Brandon, the scriptlet in your jsp gets your server's cookies from the client:
Cookie[] cookies = request.getCookies();
but on the initial request, there are no cookies set by your server on any
given client, so getCookies() returns null in accordance with the servlet
spec. That triggers a NPE when you try to process the cookies later:
for (int i=0; i<cookies.length; i++) {
...
}
Put an "if" statement around your "for" loop to check if cookies is null or
not and that should fix your problem.
Paul
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>