【发布时间】:2016-10-02 14:54:01
【问题描述】:
首先看下面的代码:
<c:choose>
<c:when test="${type != 'h'}">
<input type="password" disabled="true" id="plainText" name="plainText" value="<%=key%>"/>
以上代码是我创建的 JSP 的一部分。变量类型初始化使用:
pageContext.setAttribute("type", type);
此 JSP 在部署和使用 GlassFish Server 时运行良好,但在部署在 Apache Tomcat Server 上时显示 javax.el.ELException: Cannot convert h of type class java.lang.String to class java.lang.Long 异常。
我使用 Netbeans 自动部署在 GlassFish 服务器上,而使用 WAR 文件手动部署在 Tomcat 服务器上。
到底是什么问题?
【问题讨论】:
-
那么在你的源代码中
type是什么类型的? -
字符类型。