Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP is driving me nuts  RSS feed

 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I just spent the last 2 hours trying to figure out a problem. The most retarded problem ever. Ans I still don't know what is wrong.

Basically, take a look at the following piece of code:

<% Iterator i = classes.iterator();
while ( i.hasNext() ) {
%>
Print some static text

<% } %>

It compiles, runs, everything is perfect. Now, I add the following:

<% Iterator i = classes.iterator();
while ( i.hasNext() )
{
SClass class = (SClass)i.next();

%>
Print some static text

<% } %>

(SClass IS an existing working compiled class). And as a result of adding that ONE line of code, I get 100 errors!

Erros:

EVERE: Error compiling file: /usr/share/eclipse/workspace/ELMS Registration/work//org/apache/jsp/classes/ViewClasses_jsp.java [javac] Compiling 1 source file

/usr/share/eclipse/workspace/ELMS Registration/work/org/apache/jsp/classes/ViewClasses_jsp.java:137: not a statement
SClass class = (SClass)i.next();

^
/usr/share/eclipse/workspace/ELMS Registration/work/org/apache/jsp/classes/ViewClasses_jsp.java:137: ';' expected
SClass class = (SClass)i.next();
^
/usr/share/eclipse/workspace/ELMS Registration/work/org/apache/jsp/classes/ViewClasses_jsp.java:137: <identifier> expected
SClass class = (SClass)i.next();







............>AND SO ON

[Bear: edited for language]
[ May 21, 2004: Message edited by: Bear Bibeault ]
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using a keyword (class)as a variable name


Change it to something like and try
 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANK YOU

[Bear: edited for language]
[ May 21, 2004: Message edited by: Bear Bibeault ]
 
Gert Cuppens
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To avoid these kind of problems, I always give my classes dutch names.
It always helps me to see whether error messages have got something to do with my own classes or with the classes owned by java itself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!