• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

doubts in HFJS

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i got doubts regrading two questions in HFJS
1.) (chapter using jsp,page 330, coffee cram question 6)
<%@ page isELIgnored="true" %>
the answer is given as
E ) this page directive will only turn off EL evaluation if the DD declares a <el-ignored>true</el-ignored> element with the URL
pattern that includes this jsp
i doubt the answer to be
D ) this JSP containing this directive should NOT have any EL code evaluated by container
------------------------------------------------------------------
2.)(chapter scriptless jsps,page 356 ,be the container,question 3 )
what happens when

is forwarded an request from the servlet having the code

the answer is given as that it will print
----> Name is Evan
but isnt the 'p' object in the request scope and the jsp is trying to find it in the default pageScope ? making the code fail

thanks in advance

[ August 12, 2005: Message edited by: narendra darlanka ]

[ August 12, 2005: Message edited by: narendra darlanka ]
[ August 12, 2005: Message edited by: narendra darlanka ]
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check errata
 
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
page 330, you are correct.

page 354...when a jsp:useBean is used it tries to look for all the beans available in all scopes and it finds it in any scope and it uses it.

as it has only type in the useBean tag and no class in useBean tag...it is going to look for it and then it will use that bean and work on it.
 
narendra darlanka
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi kapil
but for the same question in(page 356 ,ans page 416)
for question no 1. the reason for failure is said to be
"FAILS at request time ! The "person" attribute in stored at request scope
so the <jsp:useBean>tag won't work since it specifies only a type.the Container KNOWS that if you have only a type specifed there must be an bean attribute of that name and scope"
from what i infer from the above explanation ,i think that an useBean tag searchs only the specified scope and if it doesnt find that name it will try to create an new one using the 'class'

so if the same reasoning is applied question 2 must also fail isnt?
thanks in advance
reply
    Bookmark Topic Watch Topic
  • New Topic