This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I am working on a session for my site but I keep getting errors on compile. See code below:
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.
If you think you've done too much, usually it means you've done too few.