I really need your help. I'm using my portlet app as usual when suddenly I have to get out of computer. When I return, there's NullPointerException. OK, why's that? Hmm... my session doesn't contain object it should hold. So, I'm probably loosing something but here's how I always looked at SessionAttributes.
I have my Controller annotated as so:
@SessionAttributes({
SOME_ATTR
})
Then I have a method with following signature:
@Valid @ModelAttribute(SOME_ATTR) SomeObject someObject
And also init method for my session attribute:
@ModelAttribute(SOME_ATTR)
public SomeObject getSomeEmptyObject() {
return someUtils.createSomeObject();
}
When I debugged my app at this point I found out that:
- manually looking into the session, there's nothing in it
- form is properly binded to
someObject
So my two big questions are:
- why doesn't Spring set
someObject
into session as well? - when the session was invalidated, why wasn't
getSomeEmptyObject()
called to fill the empty space?
Thanks in forward!