I've officially slipped into the twilight zone here. I am receiving the
weirdest JSP error (nigh the weirdest error period) of all time. I was
working on a form which uses JSP and submits it to a java bean to
process the data using jakarta struts. I tried to pull out a bit of
html controlling the border for a table, I loaded the file back up,
everything looked fine, I hit save, which uses jsp to send the info to
the java bean, and it bombed. I put the border back in, and it worked.
Keep in mind that this is pure html I'm altering, and nothing to do
with jsp. After several hours of frustration I tried replacing the
border code with the exact same number of spaces. I saved it and
everything worked fine. So I removed a space, and it worked fine. I
continued to remove spaces one space at a time until it bombed with
about half the spaces gone. I put the last space back in, and it works
fine. I looked closely at the bomb, and it bombed at the first form
element being passed, I removed it, and it bombed at the next one, and
so on and so forth. Did some one take my html and replace it with
python? Why does <table > (7 spaces) work and <table > (6
spaces bomb out in a jsp error?
Have any of you ever heard of anything like this???
Scott W Gifford - 20 Dec 2005 19:27 GMT
[...]
> I removed a space, and it worked fine. I continued to remove spaces
> one space at a time until it bombed with about half the spaces
[quoted text clipped - 6 lines]
>
> Have any of you ever heard of anything like this???
I'm not familiar with much of your toolchain, but from the general
smell of the bug, this sounds like the sort of problem that happens
when you read things in chunks, and a chunk boundary happens at an
unexpected place. For example, if you're reading in 1024 characters
at a time and processing them for HTML tags, if towards the end of the
first block you have:
<table >
^ Character 1024
then adding one more space would push it into the next block. If your
code accidentally assumes that it will always find complete tags in
each block, it will have a bug like the one you describe.
If I'm completely off the mark, well, hopefully you'll get a better
answer from somewhere else. :)
----Scott.
Monique Y. Mudama - 20 Dec 2005 20:00 GMT
> [...]
>
[quoted text clipped - 25 lines]
> If I'm completely off the mark, well, hopefully you'll get a better
> answer from somewhere else. :)
I have no better answer, but I believe that he said that 7 spaces
work and 6 don't, which seems to suggest the opposite of what you're
saying.

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
kierheyl@gmail.com - 20 Dec 2005 21:41 GMT
JSP processes through an 8kb buffer by default. My page was set to
forward to another jsp. It processes the first 8kb, finds no problems,
finds it's supposed to forward, and then shoots it on to the next page.
It doesn't need to finish processing if it's just forwarding to another
page right? Well I delete a line or two, and suddenly I have an error
within the first 8kb, and it bombs out. This is an optimization that in
rare cases can be a headache. Heads up on this one guys.