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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Question to Kathy

Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kathy,
Thanks a lot for writing such a nice book on Head First for Servlet
& JSP.But I havent understand

This example given from HF-Servlet & Jsp [Page-416]

Eg:-Look at this standard action:--

<jsp:useBean id="person" type="foo.Employee">
<jsp:setProperty name="person" property="name" value="Fred" />
<jsp:getProperty name="person" property="name" />

3> What happens if the servlet code like:-

foo.Employee p = new foo.Employee();
p.setName("Evan"); %>

HF answered that this works fine & prints out 'Evan'.

But I work it out.

FAILS at request time.person attribute is stored at request scope.
<jsp:useBean> can't find an attribute object named "person" at page scope
which is defaults scope.
Will it be wrong or right?
Suggestions are welcome!
Ranch Hand
Posts: 1026
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic