Julian Corallo

Greenhorn
+ Follow
since Mar 26, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Julian Corallo

Hi,

Further update.

I just tried this in Caucho Resin (http://www.caucho.com/) and both JSP Pages and Documents throw an error as expected.

So it looks like it is a problem in Tomcat.

Output from Caucho Resin below:



Filename TestBodyContentEmptyBug.jsp



Filename TestBodyContentEmptyBug.jspx



Cheers,

J
Hi,

Yes I posted the bug this morning - so we'll see if an answer comes back on that.

I have the Sun GlassFish Enterprise v2.1 installed as well, but unfortunately this uses Tomcat code at the back end and so exhibits the same behavior!

I'll see what other containers I can get hold of then, and try them.

Cheers,

J
Hi,

Thanks for the replies so far - I've got a little further with this problem now.

It seems that it only happens with JSP Documents and not with JSP Pages.

So when I convert my TestBodyContentEmptyBug.jspx JSP Document to TestBodyContentEmptyBug.jsp JSP Page , the container successfully throws the expected error:

Filename TestBodyContentEmptyBug.jsp




The error message seen in the browser:




So - can anyone tell me why this is? Why would a JSP Document behave differently than a JSP Page with regard to body-content?

Cheers,

J
I'm getting this problem as well and its driving me nuts. Either I completely misunderstand what a body-content of empty is meant to do, or there is a bug in my container implementation (Tomcat 6.0.18 on Linux).

I am expecting to see an error message when the second tag is encountered in the JSPX since the tag supplies a body, yet the TLD says "empty" for body-content. However my container is writing out the tag body regardless.


Here are the relevant files if someone would care to verify for me - maybe there is a really obvious mistake I've made below???


TestBodyContentEmptyBug.jspx



TestBodyContentEmptyBug.tld



TestBodyContentEmptyBug.java



Filename web.xml



Here is what my WAR file looks like:



J
Hi
Thanks for all your replies.
I'm not experienced with reg expressions - can you give me an example of how I can approach this problem using these?
To be honest, I think I'm getting into knots with the StreamTokeniser now...
String myString = "'one word','two,words',three words, 4, 5.6, 787, 0.1111, ' ', 'one_word'";
The annoyance comes in when it gets to three words as it splits it into two because it has a whitespace char inbetween. If I set ordinaryChar(' ') then it just makes it worse.
Here is my test code:

Any help much appreciated....
Cheers,
Jules
[ March 29, 2004: Message edited by: Julian Corallo ]
19 years ago
Thanks guys. I've had a play with StreamTokeniser - its a bit of a clunky class to use but does the job just fine.
For info - I'm processing records dumped from a database - where char and varchar data is encapsulated, and other data, numbers, timestamps etc are not...
e.g. 'column one char data', 'column two, char data', 3, 4, 'col 5' ....
Many thanks,
Jules
[ March 27, 2004: Message edited by: Julian Corallo ]
19 years ago
Hi,
I dunno - maybe I'm just bitter!
I thought StringTokenizer was the way forwards for processing comma separated records, until I discovered that the "delimter" you specify, is actually "delimiters"!!
So I have a comma separated string where the data in that string is enclosed in quotes - supposedly so that the data can contain the actual delimiter:
String test = "'somedata1','somedata2','some,data3'"; // 3rd item contains a comma
String delim = "','"; //doesnt work as a delimter....
Any ideas?
java 1.3.1 btw...
Cheers,
Julian
19 years ago
Hi,
First post - great set of forums!
Right - down to business...
The 1.3.1 javadoc for BufferedWriter says that the close() method "closes the stream", It also says that the close method "overrides close() in class Writer".
Now if you look at the close() method in class Writer, the javadoc says "closes the stream, flushing it first".
So you can see where I'm going with this...
From the javadoc, I'd kind of expect that a close() on a BufferedWriter would not automtically do a flush() first - but it does.

Cheers,
Jules
19 years ago