Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

doubt in jsp:usebean

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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)
 
    Bookmark Topic Watch Topic
  • New Topic