Using Spring 3 MVC and JSP, I just want to check if the user is registered, I am not interested in using Spring Security now
<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 myAppUser is not in the session yet, jsp: useBean throws an exception. Now I understand that I can have a JSP: useBean actually creates an instance of the object, giving it a class, but I donβt like to know that somewhere in some fragment of the JSP I have objects that are created and added to my session, so I either want to always set the initial value for this user and control it programmatically, or I would like to get a bean method that allows it to be null or not exist if it does not exist, just returns null
anyway will be fine
if my question indicates a fundamental misunderstanding of what I should do, provide a link to documentation that fully explains this use case