json - 如何解决 Struts 2 Json Interceptor invalid json 异常
问题描述
嗨,我将我的 struts 项目从 2.3.20 升级到 2.5.2,当我尝试运行时,它在 JsonInterceptor 中抛出异常。我无法弄清楚为什么在将 struts 升级到 2.5.2 后它会抛出这个异常。我还根据它更改了我的 struts.xml 文件。但它仍然向我显示同样的错误。谁能帮助我我所缺少的。
struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="default" extends="json-default,struts-default">
<interceptors>
<interceptor name="json" class="org.apache.struts2.json.JSONInterceptor"/>
<interceptor name="sessionInterceptor" class="com.comviva.mconnectui.custom.interceptors.SampleInterceptor"/>
<interceptor-stack name="customInterceptor">
<interceptor-ref name="sessionInterceptor" />
<interceptor-ref name="json" />
</interceptor-stack>
</interceptors>
</package>
</struts>
解决方案
推荐阅读
- android - Codepush 不适用于多个 AppRegistry.registerComponent 定义
- docker - 即使正在解析 DNS,也无法连接到同一主机中的容器
- wso2 - 如何通过请求生成不同的令牌而不撤销之前的令牌
- python - 每个班级的分组
- r - 基于R中所有列值的其他1列获取列的最小值
- python - 如何在 Django 项目中创建 requirements.txt 文件?
- html - 使用 rvest(或另一个 R 包)来检测 HTML 段落的开头何时是不同的格式(例如加粗)
- python - 如何在多索引数据框中按第二级的日期切片进行过滤
- python - 使用 opencv-python 将一批帧保存为视频
- python - 用于许多可能字符串的 Python .contains() 函数