tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Howells <chowe...@janrain.com>
Subject Re: What's the problem with Tomcat 4.1.29 and Switch?
Date Tue, 24 Feb 2004 03:02:02 GMT
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message