• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting bean from request scope

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
When i tried to get bean from request as i done in my Option1 it was getting values. but when i tried like my Option2 i am getting a string object rather than a class object.

Option1
fc.getApplication().createValueBinding("#{testBean}").getValue(fc)

option 2
beanName="\"#{"+beanName+"}\"";
fc.getApplication().createValueBinding(beanName).getValue(fc)

with the second option i am just getting a String object with the enitre package structure.
according to my requirements i have to use option2 kind of thing to know dynamically which bean is in request and process it.

Any one has any ideas what is going wrong here.

thanks in advance
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be:

beanName = "#{" + beanName + "}";

you want your resulting value of beanName to be:

#{testBean}

not

"#{testBean}"
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic