aspose file tools*
The moose likes Beginning Java and the fly likes JSP Compilation Problem - Cannot Resolve Symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JSP Compilation Problem - Cannot Resolve Symbol" Watch "JSP Compilation Problem - Cannot Resolve Symbol" New topic
Author

JSP Compilation Problem - Cannot Resolve Symbol

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I cannot see the problem. Maybe I am not sober at 2:30 am.



I got compilation error: cannot resolve symbol
symbol: background
Pankaj Narang
Ranch Hand

Joined: Jun 07, 2004
Posts: 81
Hi

Your background variabel is define in while loop and you are using that variable outside that while loop.

Define that variable outside the while loop

Best Regards
Pankaj Narang
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have tried your advice. I put the variable 'background' outside the while loop. Now, I got another compilation error:

unexpected type
required: variable
found : value
out.write("\r\n }\r\n i++;\r\n if ( postBean.getParentPostID() == 0 ) \r\n {\r\n background = \"#FFCE9C\";\r\n }\r\n else \r\n {\r\n if ((i%2) != 0) \r\n {\r\n background = \"#EEEEEE\";\r\n } \r\n else \r\n {\r\n background = \"#FFFFFF\";\r\n }\r\n }\r\n%>\r\n");

The code looks like:
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60058
    
  65

Since this has nothing to do with the fact that code is within a JSP, I'm moving this off to the Java in General(beginner) forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
this might work. Haven't tried:


And aren't we told to use ScriptLibs instead of coding lengthier sections of scriptlet, which are difficult to maintain.
This thread is a good example for that.

There must be some jstl tag which with accomplish the task in a better way.

Axel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Compilation Problem - Cannot Resolve Symbol
 
Similar Threads
Table problem under Netscape 4.75
Alighment Problem in a Table
about Database page turning question!
tags:panel not working in a particular situation
wrapping issue