我有以下代码:
<c:choose>
<c:when test="${empty sessionScope.languageRB}">
<html:hidden property="language" value="en"/>
<html:hidden property="country" value="GB"/>
</c:when>
<c:otherwise test="${not empty sessionScope.languageRB}">
<html:hidden property="language" value="<%=languageRB.getString("style.language")%>"/>
<html:hidden property="country" value="<%=languageRB.getString("style.country")%>"/>
</c:otherwise>
</c:choose>
languageRB 是存储在会话中的属性,类型为 ResourceBundle。我想做以下事情:如果会话中存在语言RB,则使用括号中字符串的值定义属性,否则将属性设置为默认值。
我收到以下错误:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 89 in the jsp file: /pages/common002-preparelogin.jsp
languageRB cannot be resolved
88: <c:otherwise test="${not empty sessionScope.languageRB}">
89: <html:hidden property="language" value="<%=languageRB.getString("style.language")%>"/>
90: <html:hidden property="country" value="<%=languageRB.getString("style.country")%>"/>