• 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Can we have jsp:getProperty without jsp:useBean  RSS feed

 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that <jsp:getProperty> can be used without a <jsp:useBean>. In this case, the tag just do a pageContext.findAttribute() to locate the named bean. If this is true, why would we ever need a <jsp:useBean>? Why it is there?
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if u use <jsp:useBean> , if the bean is not there it will be created
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Imagine you want to pass the attribute between request,session and application scope. There most be a way to give the attribute a unique
id. then with that voila, it can be accessed outside the default page scope.

Hope it help.Curiosity is the brother of invension.


SCJP SCJA
:roll:
 
MI Mohammed
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pls substitute attribute with properties.

Thanks
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we had only <jsp:getProperty> tag in the JSP it's almost like having an undeclared variable.

<jsp:useBean> is a way of declaring and initializing the actual bean object you are using in <jsp:getProperty>.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!