2017-04-04 8 views
0

XAMPP経由でインストールされたTomcatでPUTリクエストを許可する必要があります。私はウェブ上で様々な答えを見つけましたが、誰も私のために働いていません。TomcatはPUTリクエストを許可していません

<servlet> 
    <servlet-name>default</servlet-name> 
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-  class> 
    <init-param> 
     <param-name>debug</param-name> 
     <param-value>0</param-value> 
    </init-param> 
    <init-param> 
     <param-name>listings</param-name> 
     <param-value>false</param-value> 
    </init-param> 
    <init-param> 
     <param-name>readonly</param-name> 
     <param-value>false</param-value> 
    </init-param> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

が、それでも「doesnのすべてのPUT:

<security-constraint> 
<web-resource-collection> 
    <web-resource-name>allow</web-resource-name> 
    <url-pattern>/*</url-pattern> 
    <http-method>GET</http-method> 
    <http-method>POST</http-method> 
    <http-method>PUT</http-method> 
</web-resource-collection> 
<!-- no auth-constraint tag here --> 

は、私はまた、サーバーのTomcatのweb.xmlを修正しようとしました: は、私は私のプロジェクトのweb.xmlにこのコードを追加してみました仕事。 Postmanでテストされたレスポンスステータスは204ですが、このメソッドは実行されません。 私を助けることができますか?

答えて

0
<security-constraint> 
<web-resource-collection> 
    <web-resource-name>allow</web-resource-name> 
    <url-pattern>/*</url-pattern> 
    <http-method>GET</http-method> 
    <http-method>POST</http-method> 
    <http-method>PUT</http-method> 
</web-resource-collection> 
<!-- no auth-constraint tag here --> 

これらは、実行可能なメソッドを制限または「制限」します。あなたが許可したくないものだけをここに追加してください。

関連する問題