Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

doubt about useBean

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm wondering about useBean standart action. Which of it's attributes are mandatary?

I'm thinking that id and scope (according Java spec.):


type and class are optional because either type either class or even both can be used.

Am i right??
 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are right. Even the exam may have a question on the same concept like choose the mandatory attributes of jsp:usebean
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of class or type must also be specified though.
 
Kiril Nugmanov
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But neither class nor type are mandatory.

Thanks for reply.
[ November 21, 2008: Message edited by: Kiril Nugmanov ]
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the scope-attribute really mandatory, and means mandatory the same as required, because I think it is not required to have the scope-attribute.

The default value for the scope-attribute is page, so if I don't use another scope, page is used.

The statement is my eyes perfectly legal.
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think scope is not mandatory, because without being stated it is put default as page, but class or type is needed otherwise the id does not refer to anything.
 
Ranch Hand
Posts: 826
Eclipse IDE Oracle Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scope is not mandatory.
The default scope is page scope.
If it can not find the attribute in the page scope then the next scopes in order of their precedence are searched for namely in page scope ,then in request scope, then in session scope and then in application scope. And if it does not find one then it creates one in the page scope.
 
Sandeep Bhandari
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The confusion of whether class and type are mandatory is usually resolved by the exam by giving the statement like:

"If you want to create a bean"

"A servlet has set a bean in session scope, how will you use that bean"
 
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic