Thanks. I wish Damon Hougland and Aaron Tavistock knew that before they published
their Sun sanctioned book. It would have saved me a lot of frustration. I really
expected Sun's CORE books to be better then Wrox.
Their example was this which failed:
<% switch (day) { %>
<% case 1: %>
<font color="blue" size="+1">Sunday</font>
<% break; %>
<% case 2: %>
<font color="blue" size="+1">Monday</font>
<% break; %>
<% default: %>
<font color="blue" size="+1">No day</font>
<% break; %>
<% } %>
--
George Hester
__________________________________
"Carl Howells" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Because the switch statement has different syntax.
>
> <% switch (day) { %>
> <% case 1: // and so on...
> %>
>
> Could be translated to:
> switch (day) {
> out.print("\n ");
> case 1: // and so on...
>
> Which is clearly illegal syntax. There is no equivalent illegal form of
> any other block construct, which is why this only shows up with switch
> statements.
>
> George Hester wrote:
> > Well according to Core JSP by Damon Hougland and Aaron Tavistock � 2001 Prentice
> > Hall (pgs 26-28) it should work.
> >
> > For example this works:
> >
> > <% if (day == 1 | day == 7){ %>
> > <font color="red" size="+1">
> > It's the weekend!</font>
> > <% } else { %>
> > <font color="red" size="+1">
> > Still in the work week.</font>
> > <% } %>
> >
> > then why not the same for the switch? Note if breaking these tags up for the if -
> > then - else (as shown above) like in the switch I showed you then by transference
> > we'd have to conclude that the above if - then - else wouldn't work either. But
> > it does.
> >
> > So I'm confused. Why can we break the tags up in if - then - else but not in
> > switch?
> >
> > hmmm...
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]