Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is the object not bound to session?  RSS feed

 
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
Boost this thread!