File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scope of bean in jsp

 
punna Kumar
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)in jsp the java bean can not used in below scope

a)application
b)session
c)request
d)page

what is the answer for the above question
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which do you think it is and why?

We, here at Javaranch, enjoy helping people learn about Java but are loath to answer homework or test questions for you.
Please see:
http://faq.javaranch.com/view?DoYourOwnHomework

Let us know your answer and we'll be happy to comment on it but, please, don't ever post multiple choice questions to these forums.
 
punna Kumar
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Ben,

It's not a homework.......

one of my team member ask this question in chit chating in java.......

My answer is a i mean Application

java bean does not support the application level scope in jsp.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by punna Kumar:
java bean does not support the application level scope in jsp.


Really? What makes you think so?
[ July 31, 2006: Message edited by: Bear Bibeault ]
 
Stefan Evans
Bartender
Posts: 1640
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually my answer would be
e)none of the above.

Take a look at the valid values for scope when declaring a java bean on a page: http://java.sun.com/products/jsp/syntax/1.2/syntaxref1217.html#8865
 
punna Kumar
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the replay.

but there is no option like none of the above..............

<jsp:useBean> have a attribute called "scope".

i fell question is related to the what is the scope of useBean in jsp page.....

any idea.........
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by punna Kumar:

any idea


1) Move your mouse over the link in Stefan's post.
2) When the cursor changes to the little hand, click the mouse.
3) Read.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec is pretty clear about what a bean's scope is.

Scope:
The scope within which the reference is available. The default value is page. See the description of the scope attribute defined earlier herein. A translation error must occur if scope is not one of "page", "request", "session" or "application".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic