This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Very Wierd JSP Error" Watch "Very Wierd JSP Error" New topic
Author

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.
Thanks
Hetal.


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: 15950
    
  19

This is an Oracle database, �yes?


Customer surveys are for companies who didn't pay proper attention to begin with.
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
All,
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
response.sendRedirect("test.jsp?x=1&y=2");
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);
response.sendRedirect("test.jsp");
Will this submit it as POST? Any idea on this will be appreciated, its becoming painful now.
Thanks
Hetal.
Wally Schnok
Greenhorn

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...

w.s.
Anselm Paulinus
Ranch Hand

Joined: Sep 05, 2003
Posts: 389
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.
bye,
anselm
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Very Wierd JSP Error
 
Similar Threads
access rows from html table
JavaScript DataStructures
Trouble with model for calculating and adding table values dependent on multiple rows
Adding rows in JTable
How to loop through data on a jsp form?