• Post Reply Bookmark Topic Watch Topic
  • New Topic

setting a null key in request.setAttribute() method

 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me what happens when we set a null key object e.g. request.setAttribute(null,new Integer(4)); in the request.setAttribute method in a jsp.Is there any exception thrown. I tried it and on the local machine no exception was thrown but when i tried to access the jsp remotely then an IllagalArgumentException was thrown. Please can anybody explain me the exact functionality of the request.setAttribute method.

Thanks in Advance.
[ April 28, 2008: Message edited by: Saurabh Chaubey ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec and APIs don't specify what should happen if a key is null.

There really shouldn't ever be a scenario where there could be possible in your application.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request.setAttribute([string],[object]);

if you are using JAVA 5 or above then,result of auto-boxing un-boxing
request.setAttribute([string],[primitive]);

that's the way ,my dear fried and don't bother know anything about it.

best regards,
omi
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!