Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clarification On Question

 
Manpreet S Singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi in HeadFirst servlet and Jsp 5.0, on page number 358 there is a usebean problem(try problem 1 ,problem 2 is perfect). when i tried the same the result(Evan) was different from the answer given.It Can you please tell if there is any issue in the question.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

please can you post your problem with code! that will be helpful
 
Manpreet S Singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:useBean id="person" type="foo.Employee" scope="request">
<jsp:setProperty name="person" property="name" value="Fred">
</jsp:useBean>

<jsp:getProperty name="person" property="name"/>

Servlet Code:-

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

what will be the result?
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you said the value what you get is different from what is given in the book, can you please paste the value *what you get*?
 
Manpreet S Singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting result as Evan . But book says fails at Request Time.

[ July 10, 2008: Message edited by: Manpreet S Singh ]
[ July 10, 2008: Message edited by: Manpreet S Singh ]
 
sudhakar karnati
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manpreet,

This might help you..click here regarding the same topic

Thanks & Regards,
Sudhakar Karnati
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic