Made the code work:
First of all: Give yourself a favour and look for some debug strategy with jsp.
I allways have the generated java-file in the tomcat\work\localhost\theApp\what_ever_path_and_filename opened in textpad. Posted that yesterday, too. Trust me guys: Its a good idea.
Things discovered:
1.
Tomcat only interprets jsp-files as xml-syntax, if you enclose all the tags in a jsp:root - root tag.
Because you omited that element, Tomcat thought it wouldn't be xml-syntax.
2. There were some more errors: For example out.println was outside an jsp:scriptlet-tag. And
out.println(<jsp:expression>i</jsp:expression>);
results in
out.println(out.print(i));
which causes a compiler error.
I am not very experienced in writing xml, but I think even for an experienced xml-guy the normal syntax is much easier to write than xml-syntax.
I think I have read somewhere that xml-syntax is targeted for jsp-generating tools, not for humans like us. This makes strong sense to me.
3. An interesting point is that you have to write for(i=0;i<8;i++){
as
for(i=0;i<8;i++){
(btw. to post the < in ubb without being converted into < is another story!)
You have to mask the characters which have a syntactical meaning for the xml-parser, like < (start tag). I believe the xml parser converts the < in < before the jsp-engine starts generating the
servlet.
A more clever alternative should be to enclose all java-code in cdata sections. Like:
(have not tested that syntax. Should work)
[ April 11, 2002: Message edited by: Axel Janssen ]