Win a copy of Functional Design and Architecture this week in the Functional programming 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

question on el and standard action

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Q1)Which EL expression evaluates to the request URI?

1) ${requestURI}
2) ${request.URI}
3) ${request.getURI}
4) ${request.requestURI}
5) ${requestScope.requestURI}
6) ${pageContext.request.requestURI}
7) ${requestScope.request.request.URI}

the given answer is:
1

but i think its 6.

how it is 1.

Q2)A JSP page needs to instantiate a JavaBean to be used by only that page.
Which two jsp:useBean attributes must be used to access this attribute in the JSP
page? (Choose two.)
A. id
B. type
C. name
D. class
E. scope
F. create

the given answer is:
A,B

i think its A,D

A JSP page needs to instantiate a JavaBean to be used by only that page.???

what is meant here used by onlythat page?
 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think your answers are correct.
A JSP page needs to instantiate a JavaBean to be used by only that page.???

means its scope is only inside that particular jsp page.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I agrree with you about first question. The correct option is 6.

Q2)A JSP page needs to instantiate a JavaBean to be used by only that page.
Which two jsp:useBean attributes must be used to access this attribute in the JSP
page? (Choose two.)
A. id
B. type
C. name
D. class
E. scope
F. create



I am not getting the meaning of the second question. The useBean action is used to instantiate the scoped variables ( attributes) in particular scope. It also introduce scripting variables in the JSP page. But to access these variables you have to use getProperty, or EL expression or some scriptlets.

I does not understand how the useBean can access the attribute.

Thanks
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Besides the wording confusion I also go for A,D. As the bean is created in the page scope, the id is essential and as a page scope you have to instantiate the bean in the same page, so the class or beanName attribute is required.

Thanks
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a new Bean to be instantiated beanName or class is required. If you use just type, then an instance of that bean must already exist. if one does not already exist, no instance is created.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic