一、解决方法

1.先检查<jsp:useBean id="dog" class="cn.edu.dgut.el.tools.Dog" scope="request" />

中完全限定名class是否正确,最好从来类中复制过来。

2.在javaBeanl类中添加无参构造方法,如:public Dog (){}

二、原因

这是因为<jsp:useBean id="dog" class="cn.edu.dgut.el.tools.Dog" scope="request" />
最终变成下面的代码:
cn.edu.dgut.el.tools.Dog dog=null
synchronized (request){
//先查询是否有已存在该对象
dog=(Dog)_jspx_page_context.getAttribute("Dog",PageContext.REQUEST_SCOPE); if(dog==null){ //没有就新建一个
dog=new Dog(); //注意:调用无参构造方法创建对象。
_jspx_page_context.setAttribute("persion",persion,PageContext.REQUEST_SCOPE);
}
}
从上面可以看出,在创建对象是调用了无参构造方法。所以在javaBean必须有无参构造方法。

jsp:useBean报错The value for the useBean class attribute X is invalid的更多相关文章

  1. jsp页面报错(一)

    jsp页面报错 1.错误位置 <form action="../page/areaType.action" method="POST"> <j ...

  2. 数据库到jsp页面报错(一)

    数据库到jsp页面报错(一) 这个错误的确比较坑. 控制台:     页面: 解决: 神坑啊!!!

  3. 安装pandas报错(AttributeError: 'module' object has no attribute 'main')

    在pycharm中安装pandas出现报错:AttributeError: 'module' object has no attribute 'main', 刚开始以为是pip的版本太旧了,于是乎将其 ...

  4. 【pycharm】pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法

    pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法 解决方法: 在pycharm的安装目 ...

  5. mybatis报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types () or values ()

    mybatis报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types ...

  6. 解决:pipenv shell报错:AttributeError: 'module' object has no attribute 'run'

    利用pipenv shell切换到虚拟环境时,显示报错:AttributeError: 'module' object has no attribute 'run' 可以看到是d:\program\p ...

  7. 【postman】postman测试API报错如下:TypeError: Failed to execute 'fetch' on 'Window': Invalid value 对中文支持不好

    使用postman测试APi的时候,因为系统需要在header部带上登录用户的信息,所以 如下: 然后测试报错如下:TypeError: Failed to execute 'fetch' on 'W ...

  8. springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde

    springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...

  9. Pycharm安装package报错:AttributeError: module 'pip' has no attribute 'main'

    Pycharm安装package报错:AttributeError: module 'pip' has no attribute 'main' 确认pip已经升级到目前最新版本了. 在网上搜寻后,解决 ...

随机推荐

  1. 三大流行BI分析平台推荐,企业数据化选择工具

    进入大数据时代以来,对于企业来说,海量的数据不仅是财富,也是负担.无论是大型企业还是小型企业,都面临着同样的挑战--如何利用大数据客户体验,有效达到优化生产力的效果.这也是近年来许多企业选择搭建现代大 ...

  2. windev中的内存机制及其与C语言中的内存指针相似性(一)

    windev中的内存机制,是初入windev世界必须要越过的一道高山,以下我的理解和经验未必都对,如有错误或遗漏,以后再纠正或补充!另外,以下内容,咱先谈应用,再说对机制的认识和理解. 一.新建表单, ...

  3. C# mutex互斥锁构造

    概念 Mutext 出现的比monitor更早,而且传承自COM,当然,waitHandle也是它的父类,它继承了其父类的功能,有趣的是Mutex的脾气非常的古怪,它 允许同一个线程多次重复访问共享区 ...

  4. 【windows 操作系统】进程间通信(IPC)简述|无名管道和命名管道 消息队列、信号量、共享存储、Socket、Streams等

    一.进程间通信简述 每个进程各自有不同的用户地址空间,任何一个进程的全局变量在另一个进程中都看不到,所以进程之间要交换数据必须通过内核,在内核中开辟一块缓冲区,进程1把数据从用户空间拷到内核缓冲区,进 ...

  5. 【C#单元测试】 开篇

    官方:https://docs.microsoft.com/zh-cn/visualstudio/test/install-third-party-unit-test-frameworks?view= ...

  6. 60天shell脚本计划-7/12-渐入佳境

    --作者:飞翔的小胖猪 --创建时间:2021年2月26日 --修改时间:2021年3月2日 说明 每日上传更新一个shell脚本,周期为60天.如有需求的读者可根据自己实际情况选用合适的脚本,也可在 ...

  7. C语言每日一题

    66. 加一 /** * Note: The returned array must be malloced, assume caller calls free(). */ /* 从后向前(从个位)开 ...

  8. C#实现抢红包算法

    二倍均值法(公平版) 发出一个固定金额的红包,由若干个人来抢,需要满足哪些规则? 1.所有人抢到金额之和等于红包金额,不能超过,也不能少于. 2.每个人至少抢到一分钱. 3.要保证所有人抢到金额的几率 ...

  9. FlinkX

    FlinkX的安装与简单使用 目录 FlinkX的安装与简单使用 FlinkX的安装 FlinkX的简单使用 MySQLToHDFS MySQLToHive MySQLToHBase MySQLToM ...

  10. 矩池云安装gdal五种解决方案

    1.最快最靠谱的是conda conda install gdal 命令行conda/pip search gdal查看版本,选择合适的版本,例如:conda search gdal 命令行conda ...