Hi
I am getting null when i try to get a value from cookie.I think it
supposed to return either the value or "".
And also in my code i am not setting to null for ORAID.
Could you please tell me why i am getting null.
ORAID= getCookiek(request,"ORAID") ;
String getCookiek(HttpServletRequest req, String cName) throws
ServletException
{
Cookie[] cookies = req.getCookies();
if (cookies != null)
{
for(int i=0;i < cookies.length;i++)
{
if(cookies[i].getName().equals(cName))
{
return cookies[i].getValue() ;
}
}
}
return "";
}
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets