Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Very Wierd JSP Error

 
Jay Ashar
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18014
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an Oracle database, �yes?
 
Jay Ashar
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, its an oracle database.
Does it have to do anything with that??
 
Jay Ashar
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 390
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic