Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

only half jsp displayed sometimes

 
Nijeesh Balan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Thomas Hubschman
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nijeesh Balan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you Thomas.
I don't have either of them.. Could there be any other possible reasons??
Nijeesh.
 
Geeta Gune
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Constantine Pinakoulakis
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Constantine Pinakoulakis
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you ever find a solution? I am having the same issue.Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic