• 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

request.getParameter Vs request.getAttribute

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am kind of new here..and I love browsing this forum as I am still a biginner in servlet programming.Please help !
Could you please explain to me the difference btn Request.getParameter and request.getAttribute. In one of the programs I am trying to write I want to pass a value (id) from the servlet to a parent class. I can set it up as request.setAttribute(�id�, 1). But in the parent java class , (which I cannot change) it uses the value id as request.getParameter(id). I am unable to set up the variable as request.setParameter in the Java class. Could anyone please explain how to solve this�
Thanks,
Ann
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
getParameter is what you use to retrieve HTTP form parameters from a webpost and is read only.

set and getAttribute are used for binding objects to request, session, or context scope.
 
Ann Kurian
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic