jQuery in Action, 2nd edition*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question on el and standard action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question on el and standard action" Watch "question on el and standard action" New topic
Author

question on el and standard action

mani kanth
Ranch Hand

Joined: Nov 11, 2005
Posts: 57
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?
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
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.


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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
Ola Daniel
Ranch Hand

Joined: Jul 27, 2005
Posts: 105
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.


SCJP 1.4, SCWCD 1.4
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler et al, Refactoring: Improving the Design of Existing Code, 1999
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question on el and standard action
 
Similar Threads
SCWCD questions
Which answer right?
doubt about jsp:useBean
Doubt in mocktest
Please answer me this question.