1 Reply Latest reply on Apr 3, 2014 4:03 PM by FingersOnKeyboard

    Using JSTL in Glassfish, Non-serializable attribute


      I'm using JSTL in a java web project. We have to switch to Glassfish for some reason(tomcat6 before).When I deployed the project into Glasfish, following error occurs:

      java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute with name lang

      The code looks like:

      <%@ page session="true"%>

      <%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld" %>

      <%@ taglib prefix="fmt" uri="/WEB-INF/tlds/fmt.tld" %>

      <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> 

      <!-- Internationalization  -->

      <c:choose> <c:when test="${not empty param.lang}">

      <c:if test="${param.lang=='cn'}">

      <fmt:setLocale scope="session" value="zh_CN" />

      <fmt:setBundle scope="session"  basename="cubicmap.config.language.cn" var="lang"/>


      <c:if test="${param.lang=='en'}">

      <fmt:setLocale scope="session" value="en_US" />

      <fmt:setBundle scope="session"  basename="cubicmap.config.language.en" var="lang"/>




      <c:if test="${empty lang}">

      <fmt:setLocale scope="session" value="zh_CN" />

      <fmt:setBundle scope="session" basename="cubicmap.config.language.cn" var="lang" />




      The parameter "lang" is gonna be stored in session. But we know that eveything must be serialized in session. but it's JSTL, how can we do that.... I tried to search on Google with no luck, only 2 posts about this issue and no solution.