Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean Trouble  RSS feed

 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!