Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[if] session.getAttribute !=null

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
perhaps I'm going to show you an issue which has a logical error that I can't figure out. I'd like to have your opnion.

On a servlet I've got the following code

On the logger I only get the following output
2007-02-06 11:18:44,149 DEBUG [http-8084-Processor23] NewsController - update request, News ID to update (1) - 8
2007-02-06 11:18:44,149 DEBUG [http-8084-Processor23] NewsController - update request, newsList to String - [packageName.eu.model.News@1bfefb, packageName.eu.model.News@13ada, packageName.eu.model.News@bed4c8]

The log for "update request, News ID to update (2)" is not in there.
From the log I can see the ArrayList objects, so it's not null. Why the IF condition is not verified?

Thank in advance.

[ February 06, 2007: Message edited by: Alessandro Ilardo ]
[ February 06, 2007: Message edited by: Alessandro Ilardo ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
newLIst has a capital 'I' and shouldn't
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alessandro Ilardo:

if(session.getAttribute("newsLIst")!=null){


there were no error in your code but in your session name..
 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a break
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic