解决Tomcat5.5版本中“Attempted a bean operation on a null object”的错误
来源:互联网 发布:淘宝怎样实名认证 编辑:程序博客网 时间:2024/05/20 19:27
Tomcat5.5版本运行使用会话级JavaBean时,有时会出现“Attempted a bean operation on a null object”的错误。这种错误一般不会在Tomcat5.0中出现。
解决方法是在每个使用会话级JavaBean的网页中都显式声明创建JavaBean的JSP指令,该不能不会被执行,因为已经存在相应的JavaBean,但是可以确保编辑该JSP网页时,对应Servlet会在Session中寻找相应的JavaBean,而不是默认在Request中寻找相应的JavaBean。
如:
在不同JSP网页间共享会话级JavaBean
index.jsp文件:
<%@page contentType="text/html;charset=GBK"%>
<html>
<head>
</head>
<body>
<jsp:useBean id="t1" class="mypack.Time" scope="session" />
<jsp:setProperty name="t1" property="hour" value="13" />
<jsp:setProperty name="t1" property="minute" value="20" />
<jsp:setProperty name="t1" property="second" value="30" />
<a href="result.jsp">点击</a>
</body>
</html>
result.jsp文件:
<%@page contentType="text/html;charset=GBK"%>
<html>
<head>
</head>
<body>
<jsp:useBean id="t1" class="mypack.Time" scope="session" /><!--此语句在Tomcat5.5中必须要有,否则出现上述错误-->
时间为:<jsp:getProperty name="t1" property="time" />
</body>
</html>
- 解决Tomcat5.5版本中“Attempted a bean operation on a null object”的错误
- on a null object reference 错误
- android.content.Context.getContentResolver()' on a null object reference错误
- findViewById出现错误View.isRootNamespace()' on a null object reference
- attempted to return null from a method with a primitive return type (int)异常的解决
- oid android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference的解决
- 已解决错误: 'android.content.res.Resources$Theme android.content.Context.getTheme()' on a null object re
- 关于PinnedHeaderExpandableListView使用的时候on a null object reference
- on a null object reference 问题的解决办法
- "on a null object reference"问题解决方案
- 在小米上面运行时的void android.view.View.setDrawingCacheBackgroundColor(int)' on a null object reference错误
- 解决Attempt to invoke virtual method '...ListAdapter'on a null object reference
- 解决Attempt to invoke virtual method '...ListAdapter'on a null object reference
- Android开发中出现Attempt to invoke virtual method...on a null object reference
- python中‘can't use a string pattern on a bytes-like object’错误
- NullPointerException: with ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference
- monkey: android viewpager.offset on a null object reference
- ApplicationThread android.app.ActivityThread.getApplicationThread()' on a null object reference
- 浏览器战争的硝烟蔓延在JavaScript
- antenna打包中文乱码问题
- 基本测试方法
- Runtime 类的使用
- JAVA基础之dojo快速入门
- 解决Tomcat5.5版本中“Attempted a bean operation on a null object”的错误
- 解决IE里无法运行JavaScript脚本的方法
- OpenJWeb快速开发平台的多语解决方案
- “LINQ已死”论 为言论1 致歉 [Java | .Net | 致歉 ]
- C#断点续传
- sprintf学习 转载
- 怎样使用eclipse来开发android源码
- SQL数据缓存依赖 [SqlServer | Cache | SqlCacheDependency ]
- vc中SetMapeMode介绍