This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access a Bean with application scope

 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a bean which has a constructor with some arguments
I have to invoke it thtough JSP
I am doing follwing thng in my scriptlet tag
<% SomeObj x = new SomeObj(...);
bar.FooBean foobar = new FooBean(x);
application.setAttribute("foobar",foobar);
%>
where foobar is the name of the bean class
now my doubt is how can i retrive the bean
is there any method like
application.getAttribute() or some other way???

 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think that's the wrong way to call a bean ...i ,am not able to understand that why are you using set/getAttributes()...your don't need them ....you have to use a bean via introspection.
just declare functions into a bean and keep calling them into the jsp .....simple .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic