1

私の作業環境はjsp、struts 2.0、javaの下にありますそして私の問題は私がブラウザでurlの下で起動するときです

(1)https://test123.local.com/test123/test.action?id=9

それはうまくいきます

しかし、私が同じURLをupdatin 9 to9'で起動すると

(2)https://test123.local.com/test123/test.action?id=9 '

コンソールで次の例外を教えてください

重大:サーブレットのデフォルトのServlet.service()が例外をスローしました無限再帰が検出されました:

FF fireburgツールをチェックインすると、500 InternalServerErrorが表示されます。

とbodyは、このタイプのエラーを防ぐためのアイデアを持っています。例外としてこのエラーをキャッチし、制限されたページにアクセスするようにユーザーをリダイレクトする必要があります。

ここで私は私の側から見つけたより多くの詳細に言及しました。

(2)に示されているように与えられたURL

以下のような私のstruts-admin.xmlエントリ

<action name="test" method="test" class="com.os.Environment.TestAction">  
            <interceptor-ref name="customStack">  
            </interceptor-ref>  
            <result>/jsp/user/tested.jsp</result>  
            <result name="passed" type="redirect-action">passed?Id=${Id}</result>  
</action>  
<interceptor-stack name="customStack">  
                <interceptor-ref name="chainStack"/>  
                <interceptor-ref name="myCustomCheck"/>  
                <interceptor-ref name="defaultStack"/>  
                <interceptor-ref name="exception">  
                    <param name="logEnabled">true</param>  
                    <param name="logLevel">ERROR</param>  
                </interceptor-ref>  
</interceptor-stack>  

したがって、最初のcustomStackインターセプターは

以下は私のカスタムインターセプターコードです

public class myCustomCheck extends AbstractInterceptor  
{  

    private String invoke(ActionInvocation invocation) throws Exception  
    {  
        HttpServletRequest request = ServletActionContext.getRequest();  
        HttpServletResponse response = ServletActionContext.getResponse();  
        return invocation.invoke(); //this line throw the exception  
    }  

public String intercept(ActionInvocation invocation) throws Exception  
    {  
        HttpServletRequest request = ServletActionContext.getRequest();  
        HttpServletResponse response = ServletActionContext.getResponse();  
        return invoke(invocation);        
        }  

}  

上記のコードをデバッグしましたが、インターセプターが「処理された」名前アクションを呼び出さず、以下に示すように例外をスローすることがわかりました。

無限再帰が検出されました:[// test!test、//handled、//handled]-[不明な場所]com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:207)atcom.opensymphony.xwork2.DefaultActionInvocation。 executeResult(DefaultActionInvocation.java:348)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)

他の情報が必要な場合はお知らせください

4

0 に答える 0