OAS Jservlets and READING cookies

From: Hyper B Orean <hyper.b.orean_at_autonomous.org>
Date: Mon, 20 Mar 2000 08:27:16 GMT
Message-ID: <8b4ncq$u6c$1_at_nnrp1.deja.com>



It seems I am having some little problem with Jservlets under OAS [Quoted] 4.0.8.1 ... I just ported a whole heap of ex-JWEB cartridges to Jservlets for a bit of 'futureproofing'. After having to tell Oracle Support how one uses the oracle.html package AND set cookies with the standard java servlet J2EE methods, it appears that I cannot READ cookies with the standard methods; i.e. public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
Cookie theCookies[] = req.getCookies();
for (int i=0; i < theCookies.length; i++) { // some code here to get each Cookie
}
} catch (NullPointerException e) {

// error handling code
}

basically the code above ALWAYS throws NullPointerException because the array 'theCookies[]' is always NULL ... i.e. req.getCookies() returns nothing even though the J2EE information I have here says its meant to return an array of Cookie objects. I know there's cookies because I can read them in with a LiveHTML cartridge. Is there something I am not doing?? Or is this yet another stupid OAS bug or omission? Am I just forced to read in all the headers off the request object in their raw form, check for the 'Cookie' headers and then parse them myself?? I'd prefer not to if I have to. And I haven't verified that the getHeaders() method works either!!!
I can read the QueryString, and various specialised headers with their specific get() methods, all OK.
Has anyone been able to read cookies with JServlets under OAS 4.0.8.1?? This error occurs to me on both Linux and NT versions. regs
h.b.o.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Mar 20 2000 - 09:27:16 CET

Original text of this message