Forums Register Login

Bean Trouble

+Pie Number of slices to send: Send
I've been creating a 2 beans in the application scope in a servlet. In the init method of the servlet, I create the beans and then I put them in the application scope with the following:
news= new newsBean();
userInfo= new userInfoBean();
getServletContext().setAttribute("userInfo", userInfo);
getServletContext().setAttribute("news", news);
When I try to access them from a jsp page I use the jsp:useBean tag with the application scope, but when I try to reference them with jsp:getProperty I get an error. However, I can access them with scriptlets. Does anyone know why this is happening?
Thanks,
Sean
+Pie Number of slices to send: Send

Hi Sean,
Can you ellaborate more on the error message that you
are getting?Might be a problem with the scope of the implicit
objects(as the code works fine inside the scriptlets)
Manjuanth Subramanian
That is a really big piece of pie for such a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 560 times.
Similar Threads
session/application variable set in JSP, lookup in Servlet.
Spring Framework
Session question
Session in Spring
Session var set in JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:48:11.