We have a small application built using JSF 2.x. and Expression language with Tomcat 7 in Eclipse Luna.
In login.jsp,
<jsp:include page="header.jsp"></jsp:include>
Inside header.jsp,
<c:choose>
<c:when test="${sessionScope.role eq 'B'}">
<h:outputLink value="../../faces/pages/biller/Home.jsp">Home</h:outputLink> |
</c:when>
<c:when test="${sessionScope.role eq 'C'}">
<h:outputLink value="../../faces/pages/customer/Home.jsp">Home</h:outputLink> |
</c:when>
<c:otherwise>
<h:outputLink value="../../faces/pages/login.jsp">Home</h:outputLink> |
</c:otherwise>
</c:choose>
In LoginBean, I have the instance variables as "role" of "String" type. I am using @SessionScoped and @ManagedBean annotations on LoginBean also.
When I try to log-in, it throws an Exception as -->
org.apache.jasper.JasperException: javax.el.ELException: Cannot convert B of type class java.lang.String to class java.lang.Long
I am not able to understand why "sessionScope.role" is giving a "Long" value.
If anyone has any idea, please help.
Edit:
On checking, I found it is giving me another exception like this:
javax.servlet.ServletException: /pages/SignUp.jsp(56,6) '#{registrationBean.userType eq 'C'}' Cannot convert C of type class java.lang.String to class java.lang.Long
although "userType" in Registration Bean is of type "Character"
Neither the # nor $ is working.
[![The following jars I have in lib folder][2]][2]
- antlr-2.7.7
- cglib-2.2
- commons-collections-3.1
- dom4j-1.6.1
- hibernate-commons-annotations-4.0.5.Final
- hibernate-core-4.3.9.Final
- hibernate-entitymanager-4.3.9.Final
- hibernate-jpa-2.1-api-1.0.0
- jandex-1.1.0.Final
- javaassist-3.18.1-GA
- javax.faces-2.2.10
- javax.persistence-2.1.0-RC2
- jboss-logging-3.1.3.GA
- jboss-transaction-api_1.2-spec-1.0.0.Final
- joda-time-2.2
- jstl
- jta-1.1
- junit-4.9b2
- log4j-1.2.15
- ojdbc7
- org.apache.commons.fileupload
- servlet-api
- servlet
- slf4j-api-1.6.1
- standard