Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> OAS Jservlets and READING cookies
It seems I am having some little problem with Jservlets under OAS
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 - 02:27:16 CST
![]() |
![]() |