I'm following the standard MVC architecture. In my Controller I have the following code,
userDetailsBean = userDetailsDAO.getUserDetailsFromEmail(loginEmail);
session.setAttribute("userDetails", userDetailsBean);
The object userDetailsBean
contains different methods like getFName()
, getLName()
etc. I'm accessing this object from the View file as follows,
<c:choose>
<c:when test="${sessionScope.userDetails != null}">
<li>
<a href="#userName">
${sessionScope.userDetails.getFName()}
</a>
</li>
</c:when>
<c:otherwise>
<li>
<a href="#login">Log in/Register</a>
</li>
</c:otherwise>
</c:choose>
I'm getting the following error from the above code,
HTTP Status 500 - /header.jsp(22,38) The function getFName must be used with a prefix when a default namespace is not specified
I searched a lot on the internet and tried many different suggestions like,
${sessionScope.userDetails.fName}
${sessionScope.userDetails.get(0).fName}
but none of it worked,
I'm using Tomacat 6 with JSTL 1.2 and Netbeans as IDE.
Any help is appreciated, thanks in advance!