• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference?

 
Ram Dhan Yadav K
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What is the difference between
getAttributeNames()
getParameterNames() and
Are they both same or different?
thanks,
Ramdhan Yadav K
 
Maitham H
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No , they are not the same
getAttributeNames return a list of available attributes in the servlet context
getParameterNames return a list of all the parameters (the one in past in the URL) to the servlet
for more details, refer to the J2EE documentaion.
and search for the two methods above.
 
Ram Dhan Yadav K
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maitham,
I don't think attributes available through HttpServletRequest has anythig to do with servlet context. What i observed is that setAttribute() and getAttribute() available in HttpServletRequest is a way of passing objects via. a request while dispatching/forwarding the request to other servlets or web components. I guess with this functionality we can reduce the burdon on session by not overloading them with lots of objects. Correct me if i am wrong!
thanks,
Ram Dhan Yadav K
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic