• 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

SCWCD@Whiz Test Simulator - qstn....

 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Which of the following statements is true regarding the two syntax shown below for using a JavaBean component in JSP page?
a.) <jsp:useBean id="beanName" class="fully_qualified_classname" scope="scope" />

I marked this as incorrect thinking that there is no
proper definition of scope. I would agree if the scope
were declared as page or session or application or request
but IMO scope="scope" is invalid and so I marked it that way.
Does anyone else have a different opinion or am I reading between the lines ?
Thanks.
- satya
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Madhav you are right. I just wanted to check up what happens in Weblogic server if I provide scope="scope" and the follwoing turns up
Parsing of JSP File '/demo/wl2.jsp' failed:
--------------------------------------------------------------------------------
/demo/wl2.jsp(3): jsp:useBean scope must be either page, session, request, or application: scope
probably occurred due to an error in /demo/wl2.jsp line 3:
<jsp:useBean id="customer" class="rahul.UserContext" scope="scope"/>
--------------------------------------------------------------------------------
Wed Oct 24 09:45:45 GMT+03:00 2001
So I guess scope must be either page, request, session or application.
Rahul
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
scope="scope" is not to be taken literally.
it obviously implies that "scope" would be among one of the four valid scopes.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to JSP1.1 spec (page=63) we can have one of the "page|request|session|application" as the value of the scope attribute in the jsp:useBean tag. Any other value is an error. you can also omit the scope attribute in which case it takes it as the "page" scope
Sridhar

Originally posted by Deepak Mahbubani:
scope="scope" is not to be taken literally.
it obviously implies that "scope" would be among one of the four valid scopes.



[This message has been edited by Sridhar Satuloori (edited October 24, 2001).]
 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
As deepak said, don't take scope="scope" literally like id="beanName" class="fully_qualified_classname".
The question asks for the syntax.
Thanks and regards
Pradeep
Java Certification Test Simulators � J@Whiz, SCWCD@Whiz http://www.whizlabs.com/jwhiz
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As deepak said, don't take scope="scope" literally like id="beanName" class="fully_qualified_classname"
ummmm....I don't agree with the above stmt completely!
I can take id="beanName" literally.
It doesn't matter what you call the bean.
class="fully_qualified_classname" is a debatable
issue. The point I am trying to make is that these two
are user specific and can have any names, assuming
that the class is in the classpath. This is NOT my
assumption, it was alrady made in the qstn.
However, scope="scope" is invalid since this isn't
something a user has his own choice. Sure (s)he can choose
one of four values but not anything (s)he wants.
And yes its easy to say don't take it literally, but when
I give an exam and submit my response, there is no
bargaining...right!
For what its worth!
- satya
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
class="fully_qualified_classname" is a debatable
issue. The point I am trying to make is that these two
are user specific and can have any names, assuming
that the class is in the classpath. This is NOT my
assumption, it was alrady made in the qstn.

But anyone who've authored a class knows "fully_qualified_classname" does not adhere to class naming convention. Having said that, we can now assume that "scope" should also not be taken on that context.

[This message has been edited by Allan Moster (edited October 24, 2001).]
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

But anyone who've authored a class knows "fully_qualified_classname" does not adhere to class naming convention

arrrgggh!!!
But, thats' not an error.....
pstttt...I should shutup.
- satya

[This message has been edited by Madhav Lakkapragada (edited October 24, 2001).]
 
Pradeep Chopra
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
If afterall its creating ambiguity for few people, then it should be changed.
Thanks for the valuable feedback and discussion.
Thanks and regards
Pradeep
Java Certification Test Simulators � J@Whiz, SCWCD@Whiz http://www.whizlabs.com/jwhiz
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you did it so easly crackable on purpose?
 
Rahul Mahindrakar
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Just Asking"

The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.

------------------

Mahindrakar
IBM Application Server Forum Moderator

Consultant - Zensar Technologies ,Pune India.
SCJP2, SCJD2 & SCJEA (Part I)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic