Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is the object not bound to session?

 
Jingh Yi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My class that implements HttpSessionBindingListener:


My view.jsp:



My question:
Why when session dog is created, it is not bound to session? I don't see the print outs for value binding.

Thanks a lot,
Jenny
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see the setBreed() method in your class. Could this be the reason?
 
Jingh Yi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a constructor with argument of breed to set it.
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So make it a no-arg constructor (it's supposed to be a java bean, right) and create a setter for the breed. It'll probably work.
 
Jingh Yi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Melo,

You are a magic! It worked after I did what you said.

Thanks,
Jenny
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic