This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat : error on token Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Tomcat : error on token "enum" ?" Watch "Tomcat : error on token "enum" ?" New topic
Author

Tomcat : error on token "enum" ?

Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
I tried "ShowHeaders.jsp" in "java servlet and jsp- by falker and jones"
I am getting following error :-
(code works after changing "enum" to any other valid variable name)

Can any one please tell me what's goin on?

THANKS in advance....

----------------------------------------------------------------------

An error occurred at line: 8 in the jsp file: /ShowHeaders.jsp
Generated servlet error:
Syntax error on token "enum", delete this token

An error occurred at line: 8 in the jsp file: /ShowHeaders.jsp
Generated servlet error:
Syntax error on token "enum", invalid Expression

------------------------------------------------------------------------
[ August 23, 2006: Message edited by: Bear Bibeault ]

SCJP 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56179
    
  13

Moved to the Tomcat forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

What JDK are you using? It could because enum is a keyword.
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
i am using jdk 1.5/tomcat 5.5

If enum is keyword how come the authors made mistake
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

it means that main author used enum as a variable name and in java 5 enum is a keyword, so it return a compiler error as it is in violation ith language rules (the book is not for tomcat 5.5 and java 5)

you can use tomcat 5.5.x with an older jdk to compile the code with no error.
but you will need tomcat compatibility pack to use tomcat 5.5 with jdk 1.4.x

hth


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
Thank you Mr. Masoud Kalali for this thorough explanation
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Tomcat : error on token "enum" ?
 
Similar Threads
Generics in scriptlets
Exception thrown org.jboss.util.NestedSQLException
org.apache.jasper.JasperException: Unable to load class for JSP exception while navigating to jsp
Two small problems I can't seem to be able to fix
How do I solve the problem:Syntax error on tokens, delete these tokens?