servlets - 尽管传递了参数的值,但 Java Servlet 中的 request.getParameter 间歇性地变为 null
问题描述
我有2套程序,
第一个程序只是调用 URL ex:http ://sie.corp.abc.com/MyApplication/CreateSi?requestID=202112912
这是每次都使用相同的参数集调用。
在我的 Servlet 中,我将其接收为:
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String requestId = request.getParameter("requestID");
}
这里 requestID 有时为空,有时值存在。该应用程序在 JDK 13 的 tomcat8 上运行。
即使在我们有如下内容的 Spring Boot 项目中,这种行为也会产生影响:
protected void noti(@RequestParam(name = "requestID", required = true) String requestID)
这里的 requestID 有时也会为空。
请帮助,因为这会导致我们的应用程序出现很多阻塞。
不确定是否有任何我们可能需要增加的 tomcat 配置或其他东西。但服务器正在继续接收请求。
解决方案
推荐阅读
- mongodb - 无法连接到 Compass 中的副本集
- flutter - 如何知道 DraggableScrollableSheet 是折叠还是展开
- ios - 使用 Ionic 4 在 iOS 中直接调用而无需额外对话框
- r - 如何找到多分类 svm 的准确性?
- python - 为什么用 lambda 包装函数修复堆栈溢出?
- excel - 如何实现查询比较不同工作表中的 ID 并在相应行打印确认?
- excel - 在给定罢工、到期和日期的情况下提取历史期权收盘数据
- ansible - 如何增加主机上的值(Ansible)
- c++ - 如何为指令重新排序编写可观察的示例?
- mongodb - 服务特定错误:尝试通过 Windows CMD 启动 MongoDB 时出现 48