Forums Register Login

How to access a Bean with application scope

+Pie Number of slices to send: Send
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???

+Pie Number of slices to send: Send
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 .
You don't like waffles? Well, do you like this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 616 times.
Similar Threads
How are Struts action forms stored?
Variable creation inside of a loop
How keep state in C++ across JNI calls?
Sorted TreeSet from HashSet
Moving Controls in the Applet at runtime
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 00:18:27.