aspose file tools*
The moose likes Tomcat and the fly likes Tomcat : error on token Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
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: 60050
    
  65

Moved to the Tomcat forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

What JDK are you using? It could because enum is a keyword.


GenRocket - A Test Data Generation Platform
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://aspose.com/file-tools
 
subject: Tomcat : error on token "enum" ?
 
Similar Threads
Two small problems I can't seem to be able to fix
Generics in scriptlets
How do I solve the problem:Syntax error on tokens, delete these tokens?
Exception thrown org.jboss.util.NestedSQLException
org.apache.jasper.JasperException: Unable to load class for JSP exception while navigating to jsp