• 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

doubt in jsp:usebean

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<jsp:useBean id = "person" type = "foo.Employee">
<jsp:setProperty name="person" property="name" value ="fred"
</jsp:useBean>

servlet code (pg 256)

foo.Employee p = new foo.Employee();
p.setName("Evan");
request.setAttribute("person",p);

IN HFS it is given above code will run successfully
person attribute is at request scope.
so above code should not work
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

person attribute is at request scope.
so above code should not work



I agree
 
V Gala
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the code is from HFS
Can anyone give me a link of errata for HFS
thanks in advance
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I think <jsp:useBean> searches sequentially for bean in page,request,session and application scopes.


No. The scope defaults to "page".

I don't know which version of the book you have, but isn't this already in the errata ? (page 416)
 
reply
    Bookmark Topic Watch Topic
  • New Topic