Twilight Zone JSP Error

K

kierheyl

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???
 
S

Scott W Gifford

(e-mail address removed) writes:

[...]
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???

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.
 
M

Monique Y. Mudama

(e-mail address removed) writes:

[...]
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???

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. :)

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.
 
K

kierheyl

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Validaton error 3
JQuery hover error 3
Assertion Error 2
jsp and usebeans 1
call javascript library in jsp 5
JSP Methods 16
Why am I getting this error? 1
JSP Web-Development [newbie] 32

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top