Using Spring 3 MVC and JSP, I simply want to test if a user is logged in, I'm not interested in using Spring Security currently
<jsp:useBean id="myAppUser" type="com.xxx.MyUser" beanName="myUser" scope="session" />
<c:choose>
<c:when test="myUser.loggedIn">
//dostuff
</c:when>
<c:otherwise>
//dootherstuff
</c:otherwise>
</c:choose>
But the problem is that when there isn't yet a myAppUser in the session, jsp:useBean throws an exception. Now I realize that I can have the JSP:useBean actually instantiate the object by giving it a class, but I don't like knowing that somewhere in some JSP fragment I have objects being instantiated and added to my session, so I either want to always set an initial value for that user, and have control over it programatically, or I'd like a way to get that bean that allows it to be null or not exist, if it doesn't exist just return null
either way would be fine
if my question points to a fundamental misunderstanding in what I should be doing please provide a link to documentation that will thoroughly explain this use case