• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What's the difference?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the difference between
HttpServletRequest.getAttribute(); and HttpServletRequest.getProperty();
And what's the difference between
HttpSession.getAttribute(); and HttpSession.getValue();
?

Thanx!
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Meyer,
Best would be to have a look at the javadocs.
There is not really a difference between the getValue and getAttribute of the HttpSession object as the getValue was deprecated (on its way out though still supported. Not recommended to use in new development) and getAttribute replaces it. So getAttribute really needs to be used instead of getValue since v2.2 (I think :roll: )
HttpServletRequest.getAttribute returns the value of the named attribute as an Object, or null if no attribute of the given name exists. But I dont know about getProperty. I couldnt find it in the javadocs either ... Give me a clue
Cheers!
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not aware of any request.getProperty() method either.
I think you mean the 'getParameter' method (and how that's different from the getAttribute' method). If that's the case check out this post. https://coderanch.com/t/354641/Servlets/java/Difference-request-getAttribute-request-getParameter
[ March 15, 2004: Message edited by: Mayer Salzer ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic