Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

useBean doubt from enthuware.

 
Vishal Chugh
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

mock question from enthuware :

Where is the bean declared using the following useBean tag accessible?

<jsp:useBean id="jbean" class="com.jclass.JBean" />

Ans : Throughout the remainder of the page. ( I am okay with it)

but one of the other option is as below : (what is wrong with below option)
"Throughout all future invocations of the JSP as long as the session is not expired."
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishal Chugh:

<jsp:useBean id="jbean" class="com.jclass.JBean" />

Ans : Throughout the remainder of the page. ( I am okay with it)

but one of the other option is as below : (what is wrong with below option)
"Throughout all future invocations of the JSP as long as the session is not expired."


Every time JSP invocation happens, the bean declared by the action will be available in the page scope. If the scope has set to session the statement would have been the correct answer.
 
Vishal Chugh
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes!!!

Thank you Madam
 
Chithra Salam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding 1 more point, In standard action jsp:usebean if scope is not defined it has the default value =page scope .To mention session scope we need to explicitly mention the attribute scope.

Thanks,
Chithra Salam.A
SCJP5
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishal Chugh:
[q]Yes!!!

Thank you Madam [/q]


Does my name sounds like that? Because I'm a Male


[ December 29, 2008: Message edited by: Vijitha Kumara ]
 
Vishal Chugh
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Sir!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic