Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question to Kathy  RSS feed

sachin kelkar
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!
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!