首页 > 解决方案 > 如何解决 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>

标签: jsonstruts2

解决方案


推荐阅读