Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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

Clarification On Question

 
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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • 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?
 
Ranch Hand
Posts: 3389
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 ]
 
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
 
    Bookmark Topic Watch Topic
  • New Topic