• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat : error on token "enum" ?

 
Lalit Nagalkar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Tomcat forum.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What JDK are you using? It could because enum is a keyword.
 
Lalit Nagalkar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using jdk 1.5/tomcat 5.5

If enum is keyword how come the authors made mistake
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Lalit Nagalkar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mr. Masoud Kalali for this thorough explanation
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic