tags:

views:

220

answers:

7

An interesting issue which I've googled and can find absolutely no reference too, perhaps because I'm too vague on the cause myself.

I have a simple jsp page that is run from a struts 2 action. It' fairly javascript heavy, but its an internal app on my company's intranet so thats not a great problem.

All seems normal so far, right? but interestingly, the last few tags on this page fail to render. This is true for all browsers I've tried it in (IE, FF, Chrome).

What I mean by not rendering is that they simply don't exist when you view the source! whats worse, in IE, half a tag declaration is actually printed as text at the bottom of the page. All very odd.

But what makes it even stranger, if I put a few <br /> tags after the </html> tag, then all browsers render down past the </html> tag, but still cut off the last few <br />'s.

Has anyone ever heard of anything like this? I don't even know where to start troubleshooting! I know my description is vague but that's only because I'm a bit vague on it myself.

A: 

Sounds like you have an unclosed quotation mark somewhere. Or something like that. Stuff like that can mess up even the source view as some browsers don't show the exact bytestream they received in the socket in source view (I know for a fact that IE used to do this). Try doing a GET with wget or a telnet client or something similar and see what happens.

DrJokepu
+1  A: 

If 'View Source' does not show you the tags then it is not a rendering problem, but a server or network problem, as the content is not being delivered to the browser.

Sparr
That sounds logical except it's breaking on the same tag (a div) every time in the same location. so unless there's an intelligent gremlin hiding in our network...
Josh Bones
Sounds like your JSP or Struts code is broken somewhere around the point where it outputs that div.
Sparr
A: 

We should see the code of your jsp to answer. I suspect there is an unclosed tag or a an unclosed quotation mark of an attribute - as DrJokepu said - in the jsp.

alexmeia
I know its hard to nut this out without being able to see the code but unfortunately I can't put it up here since its company work. But I can say emphatically that its not an unclosed quotation mark, The wonders of code highlighting as well as me manually trawling through the page assure me of that
Josh Bones
A: 

That is the first time I have heard that IE is behaving the same way as the other browsers; by accident...

But seriously, is the html error-free?

I recommend using the html validator extension for Firefox to show you if the html is producing any errors or warnings.

There has to be an error somewhere, but without the code it is impossible to say what it is.

jeroen
+1  A: 

It sounds like a buffer flush problem to me. Have you got any filters that might be buffering the html before it gets to the browser?

Alohci
A: 

Thanks for the assistance all, but unfortunately none of these seemed to help. I've found a hacky way around it and since its not a critical app, It'll just have to do.

thanks again

Josh Bones
A: 

I had a problem some time back with a web-site that was getting 'cut-off' and similarly, I solved the problem with a quick hack but never a proper solution. What it came down to for me was that the web server seemed to require the content-length of the page for it to render properly. When I buffered the output and added the content length, the page would load in full. Different technology though - this was an application built on Perl CGI running on Apache 2.2.

lintunen