java.lang.IllegalStateException报错
系统在加载一个jsp页面的时候偶尔出现报错,求高手分析一下原因,报错信息如下:[13-11-6 8:15:34:963 CST] 00000039 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet 错误]-[/sys/news/sys_news_main/sysNewPortletSeveralImage.jsp]: java.lang.IllegalStateException
at com.ibm.ws.session.http.HttpSessionImpl.setAttribute(HttpSessionImpl.java:248)
at com.ibm.ws.session.SessionData.putSessionValue(SessionData.java:292)
at com.ibm.ws.session.SessionData.setAttribute(SessionData.java:216)
at com.ibm.ws.session.HttpSessionFacade.setAttribute(HttpSessionFacade.java:169)
jsp页面代码:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="org.springframework.context.ApplicationContext,
org.springframework.web.context.support.WebApplicationContextUtils,
com.landray.kmss.common.service.IXMLDataBean,
com.landray.kmss.common.actions.RequestContext,
com.landray.kmss.util.StringUtil,
java.util.*
"%>
<%@ include file="/resource/jsp/htmlhead.jsp"%>
<script>
Com_IncludeFile("portal.css", "style/"+Com_Parameter.Style+"/portal/");
</script>
</head>
<body>
<center>
<div id="_divFlashNews"></div>
<%
// 从数据库取得数据
ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(session.getServletContext());
RequestContext requestInfo = new RequestContext(request);
IXMLDataBean bean = (IXMLDataBean) ctx.getBean("sysNewsMainPortletService");
List newsList = bean.getDataList(requestInfo);
pageContext.setAttribute("newsList", newsList);
%>
<script>
function getFlashNews()
{ --------------------编程问答-------------------- pageContext.setAttribute有三个参数。 --------------------编程问答-------------------- 1.在程序中添加:
out.clear();
out = pageContext.pushBody();
就可以了;
2,不要在%〕〔%之间写内容包括空格和换行符
3,在页面写入图片的时候,需要flush()
OutputStream output=response.getOutputStream();
output.flush();
4,在页面确定写入<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312”> --------------------编程问答--------------------
这与是否写第三个参数应该没有关系吧
补充:Java , Java EE