my dog learned polymorphism
The moose likes JSP and the fly likes Very Wierd JSP Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Very Wierd JSP Error" Watch "Very Wierd JSP Error" New topic

Very Wierd JSP Error

Jay Ashar
Ranch Hand

Joined: Oct 13, 2002
Posts: 208
Hi all,
I have written a JSP, which works in pretty standard way. I am using JDBC to pull rows from database and display it on page, users can update those rows and then hit submit which will update those rows in database. ALl this works fine if number of rows are less than 100 or so. But if it brings back huge amount of data like more than 150 rows or somehting, I am getting "Service Unavailable, zero size object" error pn browser.
I checked iPlanet logs, there is a nullpointer exception. This is very wierd, its not consistent.
I had thought I might be using GET method of form which restricts the amount of data but I am using POST method, are there any restrictions for POST method?
Can someone please help, I am trying to solve this for days now.

SCJP 1.4<br />SCWCD 1.3
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
You're going to have to post an example of what your code is doing for anybody to be able to help you. 150 rows isn't necessarily that much data...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

This is an Oracle database, �yes?

An IDE is no substitute for an Intelligent Developer.
Jay Ashar
Ranch Hand

Joined: Oct 13, 2002
Posts: 208
Yes, its an oracle database.
Does it have to do anything with that??
Jay Ashar
Ranch Hand

Joined: Oct 13, 2002
Posts: 208
I think I now know why this is happening but I dont know the solution for this. Maybe some of you'll could help. It breaks on
and I think its breaking on this because this redirects the form as GET request and so if it has more data then GET can take it breaks.
So is it true that whenever you do sendredirect it always submit as GET method of the form. How can I change it to go in as POST??
will it work if I did something like
request.setAttribute("x" 1);
request.setAttribute("y" 2);
Will this submit it as POST? Any idea on this will be appreciated, its becoming painful now.
Wally Schnok

Joined: May 31, 2001
Posts: 29
if it's IE 4.0 you know that GET is limited to 256 characters , so if you have more it breaks ....
try to test with some other browser , if this is the case...
obviuos, the solution is to post it in POST , as you said....
and post some source code here , from your jsp...

Anselm Paulinus
Ranch Hand

Joined: Sep 05, 2003
Posts: 390
My advice to you is to refactor your application so that you access the database from a Servlet rather than from the JSP(not the best design but better than what you currently have); then you can have control of where the sendRedirect is called from; that is you can call it from you doPost method; atleast you are sure that it will be a post and not a get.
I agree. Here's the link:
subject: Very Wierd JSP Error
It's not a secret anymore!