• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About jsp:useBean on p.420 Head First

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On p. 420 of Head First JSP and Servlet:





Fails at request time! The person attribute is stored at request scope, so that the <jsp:useBean> tag won't work since it specifies only a type. The container knows that if you have only a type specified, there must be an existing bean attribute of that name and scope.



I tried something like this in a servlet:


In the JSP where this servlet forwards to:


My code works fine. It prints out dummy as the first name.
But according to Head First, it should not.

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2534
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right, check HFSJ errata.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic