Malin
Malin

Reputation: 41

Large JSP response is truncated :(

I have a JSP accessed through JBoss. It renders a list (a search result). If the response gets big, approximately larger than 200k the response is truncated. I can see how the page just ends in the middle of a tag in Firefox. IE totally freaks out an so does Fiddler. Responses smaller than 200k are no problem.

Anyone has experienced this? I don't know where to look for the problem... any suggestions are welcome.

Upvotes: 4

Views: 3201

Answers (5)

Ujjwal Singh
Ujjwal Singh

Reputation: 4998

Add this to your code:

<%@ page buffer="none" %>

My best guess so far is that - in normal viz. buffered mode the output is written to a buffer and if some how the server page has 'finished' completely - a part of the output is stuck in the ether (buffer).

When you disable the buffer - the output from the jsp gets sent to the client as soon as it is generated.

Upvotes: 2

Malin
Malin

Reputation: 41

Thank you all again. During the pasted days I've experienced a disk crash, vomiting children and a trip to Spain.

Since the disk crash I cannot reproduce this behavior! I have not lost any code and I have the exact same JBoss. But I have a slightly different Java and Firefox version. No Fiddler installed (although I had it turned off on my old machine).

I still have no clue what caused it. But also I don't care anymore :P

Upvotes: 0

Tony BenBrahim
Tony BenBrahim

Reputation: 7290

I second Henning's suggestion. I have used JSPs on JBoss to return multi megabyte responses, I would look at the code or possibly an intermediate proxy server rather than JBoss.

Upvotes: 0

Henning
Henning

Reputation: 11696

If your JSP renders a very complex html page, then it might just be the browsers tripping over their own feet. Can you retrieve the page via wget or curl? Is it truncated then, too?

Upvotes: 3

Victor
Victor

Reputation: 9269

Maybe it has something to do with flushing the buffer? thath number (200k) ringed the bell of a problem I had with it. Place a page directive like this:

<%@page buffer="500kb" autoFlush="true" %>

and play with the buffer size and autoflush values.

Upvotes: 1

Related Questions