This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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"
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic