• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Session Scope, HttpSessionAttributeListener

 
jr gil
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given:
<jsp:useBean id="BoltsBean" class="parts.BoltsBean" scope="session" />
<jsp:setProperty name="BoltsBean" property="*" />
I seem to have the appropriate setters and getters in the BoltsBean class. From this jsp page I <jsp:forward /> to another page which does <jsp:getProperty /> on one of the named properties and it displays the value properly.
I also have a HttpSessionAttributeListener configured in the web.xml file. The attributeAdded method is notified and I seem to be able to retrieve the BoltsBean object by
public void attributeAdded(HttpSessionBindingEvent se) {
HttpSession hs = se.getSession();
String name = se.getName();
BoltsBean bb = (BoltsBean)hs.getAttribute(name);
At this point bb is not equal null(I checked), however if I try and do the getter method on the property the method returns null.
Any Ideas ???
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if your bean returned ok from session, the problem seems to be somewhere in its method
you try to get. it's hard to say where exactly, so if you want, publish your bean's and jsp's code.
 
jr gil
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will look at that part of it a little closer and see if I see anything. Thanks for the reply !!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!