Win a copy of AWS Security this week in the Cloud/Virtualization 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

JSP Translation Time

Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deshmukh book says that " The same Java Bean name is not used more than once in a single tranlation unit".

Does that mean , i can do something ..i should not be doing following in same JSP page . Below i am trying to get attribute named "XYZ" and "LMN" that store "MyBean" object.

<jsp:useBean id="XYZ" class="foo.MyBean" scope="Session" />

<jsp:useBean id="LMN" class="foo.MyBean" scope="Session" />

Can anyone help me in understaning the meaning of the statement
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The name is the key and ought to be unique. If you're creating another bean with the same name (id), then it will override any previously created bean in the same transaction/scope.
You've gotta fight it! Don't give in! Read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic