wood burning stoves 2.0*
The moose likes JSP and the fly likes only half jsp displayed sometimes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "only half jsp displayed sometimes" Watch "only half jsp displayed sometimes" New topic
Author

only half jsp displayed sometimes

Nijeesh Balan
Ranch Hand

Joined: Oct 09, 2000
Posts: 116
Hi,
Sometimes it doesn't display the complete jsp page. If i press the back button and see the jsp again it is displayed completely.
This occurs rarely.
Could there be any specific reason for this behaviour?
Please let me know if you have some inputs.
We are using Websphere 4.0.4 with IBM Http Server
Thanks & Regards,
Nijeesh.


Thanks & Regards,<br />Nijeesh.
Thomas Hubschman
Ranch Hand

Joined: Sep 25, 2002
Posts: 88
Nijeesh,
The first possibility could be that you are flushing the response buffer on those pages which are exhibiting the behavior.
Or perhaps you are returning from a custom tag with an int value of Tag.SKIP_PAGE
I'm sure there could be others, but these are two off the top of my head.


SCJP '02, SCWCD '02, SCJD '08, SCSNB '09, SCEA '10
Nijeesh Balan
Ranch Hand

Joined: Oct 09, 2000
Posts: 116
Thanks you Thomas.
I don't have either of them.. Could there be any other possible reasons??
Nijeesh.
Geeta Gune
Greenhorn

Joined: Mar 19, 2002
Posts: 17
The jsp page is displayed incomplete because the buffer size set will be less than the actual output. By default the buffer size is 8kb. if the jsp page's output is more than that then u need to increase the buffer size by setting it in the page directive as buffer="12kb"(just an example).
I hope this solves ur problem
geeta
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60781
    
  65

Buffer size is most probably not the problem. If the buffer is too small to hold the whole page at once, the buffer will be flushed repeatedly as it fills and will not cause the page to be truncated.
The most likely cause is that an exception or other abortive event is being thrown after the buffer has been flushed at least once.
Carefully check through your logs for clues to find out what is happening to cause the JSP execution to abort prematurely.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Constantine Pinakoulakis
Greenhorn

Joined: Dec 05, 2003
Posts: 3
Hi,
I'm facing the same problem (jsp not fully displayed) and still have not been able to solve it.
What I'm doing is to bring into the page a Vector consisting of strings (each about 150 characters long), loop through its elements and print them on the page. The whole Vector is brought OK into the page, I checked it.
When the vector contains more than about 35 elements, the page is not fully displayed.
Changing the page buffer from its default value (8 kb) to 64 and subsequently 128 kb resulted in nothing at all being displayed in the page and a '500 internal server error' appearing on the browser window. It therefore seems to produce some effect, but I don't know what to make out of it.
Whenever the problem occurs, Tomcat complains about an exception in StringTokenizer, which I am using to manipulate the contents of the strings. This suggests some error in the JSP/HTML code; however, if this were the case, wouldn't the error have affected the whole page? After all, I'm doing exactly the same thing to all the strings in the vector. I don't understand how the code could work for the first 30 or so elements and _then_ get stuck.
By the way, I also checked the strings for characters like "<", ">" etc. that could possibly interfere with the HTML in the page, but have found none. Also, I tested the page with both IE 6 and Opera 7.11 browsers and they display exactly the same output.
Any ideas?
Thanks in advance.
Constantine
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60781
    
  65

Have you performed a View Source to check what's actually being sent to the browser (as opposed to merely what it is displaying)?
bear
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
In my experience the most likely solution is simply that the page is taking too long to be sent from the server to the browser. IE, in particular, is terrible for just giving up listening if some internal timeout is exceeded.
Are you sending part of the page, then (for example) building the rest from a relatively slow database query?
If this is the case, one solution is to actually increase the buffer size beyond the size of your page, and then manually flush thhe buffer when you have built the whole page. Browsers are usually happier to wait longer for the start of a page than during the rendering of a page. If this doesn't work, consider fetching the database results into a temporary variable before any data is sent to the browser, then using this cached data in the page instead of a live query.
Or have I missed the point?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Constantine Pinakoulakis
Greenhorn

Joined: Dec 05, 2003
Posts: 3
Thanks very much for the replies.
1. View source: I did do a 'view source' only to find out that the source matches the output displayed by the browser. The source ends abruptly in the middle of a <td> section.
2. The query to the database is done by a different class (I'm using a rather complicated MVC design). The results are stored in a vector, which is then passed as a parameter to the JSP in question, i.e. the JSP doesn't know about the database. For testing purposes, I added to the JSP code a statement that just prints the last element of the vector (that is to say the very last line of the query's result), and this particular line was printed properly. It seems that the data is there, but for some reason it does not make it to the browser when its length exceeds some limit. As I wrote in my first post, both Opera and IE6 behave _exactly_ the same way. I also tried to flush the buffer manually, but with no result.

Constantine
astoddart Stod
Greenhorn

Joined: Jan 22, 2010
Posts: 2
Did you ever find a solution? I am having the same issue.Thank you
 
Consider Paul's rocket mass heater.
 
subject: only half jsp displayed sometimes
 
Similar Threads
Page Expired Problem
triming spaces
query about flush method?
Javascript getting displayed on Screen
Dynamic Dropdowns