Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session problem

 
shaf maff
Ranch Hand
Posts: 180
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

I am working on a session for my site but I keep getting errors on compile. See code below:


Error:
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try casting to a Long instead of a long.
 
ujjwal soni
Ranch Hand
Posts: 403
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Try this

 
Vadim Vararu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shaf maff wrote:Hi Guys

I am working on a session for my site but I keep getting errors on compile. See code below:


Error:



Hi buddy! I guess you have two problems here. First one is "(long)". You can't use primitive types for casting objects. Second one, i guess, is that your code will call session.getAttribute("userid") even if your session happens to be null. response.sendError(501) will not return you from method. It'll just set a header with error status instead and you'll probably get a null pointer exception.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic