- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我将表数据发送到jsp页面以及ajax调用数据发送成功时。但 jsp 页面我收到此错误。我不知道如何修复错误。我附上了错误和代码如下
org.apache.jasper.JasperException:PWC6033:JSP 的 Javac 编译出错
PWC6199: Generated servlet error:
source value 1.5 is obsolete and will be removed in a future release
PWC6199: Generated servlet error:
target value 1.5 is obsolete and will be removed in a future release
PWC6199: Generated servlet error:
To suppress warnings about obsolete options, use -Xlint:-options.
PWC6197: An error occurred at line: 17 in the jsp file: /sales_add.jsp
PWC6199: Generated servlet error:
cannot find symbol
symbol: class product
location: class org.apache.jsp.sales_005fadd_jsp
PWC6197: An error occurred at line: 17 in the jsp file: /sales_add.jsp
PWC6199: Generated servlet error:
cannot find symbol
symbol: class product
location: class org.apache.jsp.sales_005fadd_jsp
PWC6197: An error occurred at line: 17 in the jsp file: /sales_add.jsp
PWC6199: Generated servlet error:
cannot find symbol
symbol: class product
location: class org.apache.jsp.sales_005fadd_jsp
PWC6197: An error occurred at line: 17 in the jsp file: /sales_add.jsp
PWC6199: Generated servlet error:
cannot find symbol
symbol: class product
location: class org.apache.jsp.sales_005fadd_jsp
Jsp页面
<%
String jsonData = request.getParameter("data");
Gson gson = new Gson();
product data1 = gson.fromJson(jsonData, product.class);
String item = data1.getItem();
int price = data1.getPrice();
int qty = data1.getQty();
int total = data1.getTotal();
product user = new product();
user.setItem(item);
user.setItem(price);
user.setItem(qty);
user.setItem(total);
String jsonObj = gson.toJson(user);
out.print(jsonObj);
%>
最佳答案
此消息:
> PWC6199: Generated servlet error:
> source value 1.5 is obsolete and will be removed in a future release
可能意味着您的 Web 容器尚未配置用于生成代码的 Java 版本,并且假设为 Java 5。请检查 Web 容器配置。
解决方案:检查Web容器文档。或者忽略该消息。 (这是警告而不是错误。)
其他错误是由于 JSP 中缺少导入造成的。您尝试使用名为 product
的类,但 Java 编译器找不到它。
解决方案:在页面开头添加导入。语法是
<%@ page import="java.util.List" %>
...并且您需要为您的类使用正确的完全限定名称。
(您也可能拼错了名称。风格正确的类名称将是 Product
。)
其他评论:
product
,请修复它。这是一个重大的风格错误。它应该是产品
。正如 @Scary Wombat 指出的那样,您不应该不将 JSP 用于任意 Java 代码。使用 JSTL 编写逻辑(在本例中不实用),使用 Servlet 实现,或者使用 Spring Boot/Spring MVC 或类似技术。将任意 Java 代码放入 JSP 中会带来各种技术和可维护性问题。
JSP 应该只真正用于将 Servlet 的结果呈现为 HTML 输出。它们不应包含业务逻辑,
关于java - 生成的 servlet 错误 : source value 1. 5 已过时,将在未来版本中删除使用 Jsp 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58704693/
我是非洲的一名学生,在我们的土地上,确实存在缓慢且昂贵的互联网连接,这就是为什么每当我们听到安装软件的“在线存储库”方法这个词时都会害怕得发抖。该死的,这通常意味着你必须去别处看看。 问题。(如果没有
我正在使用 OpenCV 1 进行一些图像处理,并且对 cvSetErrMode 函数(它是 CxCore 的一部分)感到困惑。 OpenCV 具有三种错误模式。 叶:调用错误处理程序后程序终止。 父
安装新版 IDEA.14 后,(maven)项目的部署显着增加(从 15 秒增加到 47 秒)。 最佳答案 原因: IDEA 使用 捆绑 Maven的版本 解决方案:设置 (ctrl+alt+S) -
在 .NET 中,您可以将某些方法标记为过时,以便开发人员在尝试使用已弃用的方法时收到警报。 Private Sub FormerMethod() 问题是您只能在您控制的类中执行此操作。当您希望开发
一段时间以来,我一直在尝试自己解决这个问题,但一直没有成功。当我大约有 10% 的时间重新部署我的 Rails 应用程序时,就会发生这种情况。其他 90% 的时间部署顺利进行。 我试了又试,还是没成功
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我正在学习 HTTP/2 协议(protocol)。它是一个带有小消息帧的二进制协议(protocol)。它允许在单个 TCP 连接上进行流复用。从概念上讲,它似乎与 WebSockets 非常相似。
在 Matlabs 的最新版本中,specgram 函数被 spectrogram 取代,文档说明: Note. To obtain the same results for the removed
我们试图在构建时标记外部类型(如 ConfigurationManager)的使用。 自定义代码分析字典可以提供帮助 [1],但仅限于项目中包含源代码的情况。同样,Obsolete 属性适用于项目中包
我将 Anaconda 与 Python 3 结合使用,并尝试安装 cc 包,这是 uber h3 包的要求。 尝试通过以下方式在 anaconda 命令行中安装时: pip install cc 我
我在 Razor 中创建了一个专门用于显示货币的显示模板,现在我想在我的代码中删除它并替换为接受字符串格式(我可以将其设置为“C”)的标准文本显示模板。 然而,出现了很多次,所以我想使用类似 [Obs
我希望我的网站具有如下所示的 URL: example.com/2010/02/my-first-post 我有我的 Post带 slug 的模型字段('我的第一篇文章')和 published_on
4.7 并喜欢在 qgraphicsview 上叠加两个图像。顶部的图像应是半透明的,以便能够透过它看到。最初,两个图像都是完全不透明的。我期望存在一些为每个像素设置全局 alpha 值的函数,但似乎
总结: 我在我的 Swift 代码中犯了一个错误,我已经修复了它。然后我问自己为什么会这样,我该如何避免。我尝试了一些方法,但没有任何帮助。 我把错误和我的想法放在下面。我希望你能教我避免这种错误的正
我正在尝试重命名在 SVN 中跟踪的 Java 包。这一切似乎都有效。它将代码移动到新包等。然而,噩梦就在那时开始,乐趣就开始了,这取决于你的观点。摆脱旧包很难。 我陷入了“过时”或“不存在”消息的循
我们使用 NLog 或 Serilog 进行日志记录。我们正忙于将系统从 ASP.NET 移植到 ASP.NET Core,这 has logging built in . 理想情况下,我们希望放弃
ETag header 的定义 ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag ): The ETag HTTP re
我是一名优秀的程序员,十分优秀!