| 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
|
|
|
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
|
 |
 |
|
|
subject: Tomcat : error on token "enum" ?
|
|
|