0
您能否帮我解码使用JSTL本地化的GAE托管JSP页面中的异常?使用JSTL本地化无法解码GAE托管JSP页面中的异常
它在dev服务器上工作,但生产失败,所以我不能真正调试它。我也试着用Google搜索。
异常不给我有意义的信息:(
java.io.NotSerializableException: javax.servlet.jsp.jstl.fmt.LocalizationContext
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at java.util.HashMap.writeObject(HashMap.java:1018)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
JSP页面非常简单:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.google.inject.Injector" %>
<%@ page import="com.mine.courierApp.server.Ofy" %>
<%@ page import="com.mine.courierApp.server.model.Order" %>
<%@ page import="com.mine.courierApp.server.model.DatastoreObject" %>
<%@ page import="com.googlecode.objectify.Key" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title></title>
</head>
<body>
<c:if test="${lang == null}">
<fmt:setBundle basename="com.mine.courierApp.server.Strings" var="lang" scope="session"/>
</c:if>
<c:if test="${param.lang != null}">
<fmt:setLocale value="${param.lang}"/>
<fmt:setBundle basename="com.mine.courierApp.server.Strings" var="lang" scope="session"/>
</c:if>
<%
String orderId = request.getParameter("id");
Injector inj = (Injector) application.getAttribute(Injector.class.getName());
Ofy ofy = inj.getInstance(Ofy.class);
Key<DatastoreObject> key = Key.create(orderId);
Order order = (Order) ofy.load(key);
if (order != null)
application.setAttribute("stateId", "OrderState." + order.getState().name());
%>
<fmt:message key="StateOfOrderMsg" bundle="${lang}"/>
<b><fmt:message key="${stateId}" bundle="${lang}"/></b>
<br/>
</body>
</html>