2017-10-13 14 views
1

私の疑問に似た他の投稿が既にあることは知っていますが、問題は解決できないということです。 外部アプリケーションが(呼び出しを変更することはできません)URLを通じて要求を行うので、私は、名前を「passport.jsp」にマッピングされなければならないサーブレットを持ってhttp://myipserver:portserver/nameApplication/passport.jsp?xxx この時点で私のweb.xmlはここにある:web.xml security-constraintで例外を設定する

<servlet-mapping> 
    <servlet-name>PortalServlet</servlet-name> 
    <url-pattern>/passport.jsp</url-pattern> 
</servlet-mapping> 

問題は、「* .jsp」マッピングであるため、私のsecurity-constraintのマッピングがサーブレットpassport.jspの定義よりも優先されるということです。

<security-constraint> 
    <display-name>EsconderJSP</display-name> 
    <web-resource-collection> 
     <web-resource-name>JSP</web-resource-name> 
     <description/> 
     <url-pattern>*.jsp</url-pattern> 
     <http-method>GET</http-method> 
     <http-method>POST</http-method> 
    </web-resource-collection> 
    <auth-constraint> 
     <description/> 
     <role-name>jsps</role-name> 
    </auth-constraint> 
</security-constraint> 

これを解決する方法を知っている人はいますか?サーブレット "/passport.jsp"を例外として追加することができます。

ありがとうございました。

答えて

0

を保護します。ありがとう

0

あなたは何の保護

<security-constraint> 
    <web-resource-collection> 
     <url-pattern>/passport.jsp</url-pattern> 
    </web-resource-collection> 
    <auth-constraint> 
     <role-name>*</role-name> 
    </auth-constraint> 
    <user-data-constraint> 
     <transport-guarantee>NONE</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

を持っていないか、またはあなたが保護される別の何かで起動するアプリケーションの要求を変更することができ、その上、他のセキュリティ制約を追加することができます。これにより、パスポート要求は保護されません。

http://myipserver:portserver/nameApplication/otherRequests/foobar.jsp 

http://myipserver:portserver/nameApplication/passport.jsp 

だけ、私はちょうどそれが働いているアンを私のweb.xmlに新しいタグを追加する(他のセキュリティ制約)

<security-constraint> 
    <web-resource-collection> 
     <web-resource-name>free pages</web-resource-name> 
     <url-pattern>/passport.jsp</url-pattern> 
    </web-resource-collection> 
</security-constraint> 

解決/otherRequests/*

<url-pattern>/otherRequests/*</url-pattern> 
+0

こんにちは!ご注意いただきありがとうございます。私はあなたの先端で私の問題を解決する。 空きページ /passport.jsp

関連する問題