一、解决方法

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. Oracle账户被锁:the account is locked

    转至:https://blog.csdn.net/weixin_37615080/article/details/80400239?utm_medium=distribute.pc_relevant_ ...

  2. ubuntu 下的ftp安装及root身份远程配置

    第一步:在 Ubuntu 中安装 VSFTPD 服务器 //安装 VSFTPD 二进制包 $ sudo apt-get update $ sudo apt-get install vsftpd //使 ...

  3. c/c++(c++和网络编程)日常积累(二)

    Linux下C编程通过宏定义打开和关闭调试信息 https://www.cnblogs.com/robinsons/p/3667032.html https://blog.csdn.net/u0134 ...

  4. Windows原理深入学习系列-访问控制列表-关于安全描述符的补充

    这是[信安成长计划]的第 20 篇文章 0x00 目录 0x01 安全描述符的结构 0x02 两个结构的不同点 0x03 真正的查询方案 0x04 参考文章 0x01 安全描述符的结构 在上一篇文章中 ...

  5. .net core 学习笔记一 Program与Startup

    一.Program文件: 1.CreateWebHostBuilder(): 构建web服务2.WebHost.CreateDefaulBuilder(): 使用默认配置,包括 1.使用了Kestre ...

  6. 随机数据生成工具Mockaroo

    测试用例生成工具:https://www.mockaroo.com/ 网站描述是:Random Data Generator and API Mocking Tool | JSON / CSV / S ...

  7. 分页PHP

    <?php//1.连接数据库$link = mysqli_connect('127.0.0.1','root','root','1906');//2.设置字符集mysqli_set_charse ...

  8. laravel7 下拉搜索

    html:页面 首先给下拉框一个页面改变事件,将下拉框的值发送至后台,进行查询 <select name="interest" id="serarch" ...

  9. 华为交换机配置ACL详细步骤

    ACL 介绍 #2000-2999普通ACL,根据源IP过滤 #3000-3999高级ACL,根据源目的端口和源目的地址等过滤 #4000-4999二层ACL,根据源目的MAC等过滤 配置举例: 拒绝 ...

  10. 初探JVM字节码

    作者: LemonNan 原文地址: https://juejin.im/post/6885658003811827725 代码地址: https://github.com/LemonLmNan/By ...