简体   繁体   English

如何跳过某些http请求的重定向到https? 如何在jboss Web子系统中配置它?

[英]How to skip redirection to https for some http request? How to configure this in jboss web subsystem?

I have a requirement in my application where all http request are redirected to https but there is some code in my java servlet where we create http request through code and send it to jobss server where it is translating to https request. 我的应用程序中有一个要求,其中所有http请求都重定向到https,但是我的java servlet中有一些代码,我们在其中通过代码创建http请求并将其发送到Jobs服务器,在此它转换为https请求。 But as my servlet do not have capability to handle https response and I do not want to change the servlet code. 但是由于我的servlet没有处理https响应的能力,所以我不想更改servlet代码。 Is there any way to configure in jboss web system to skip redirection of this http request to https request? 在jboss Web系统中,有什么方法可以配置为跳过此http请求到https请求的重定向?

You can add security constraint like this in web.xml to disable https for few pages 您可以在web.xml中添加这样的安全性约束,以禁用几页的https

<security-constraint>
  <web-resource-collection>
    <web-resource-name>pageswithouthttps</web-resource-name>
    <description>No Description</description>
    <url-pattern>/nohttps/*.jsp</url-pattern>
  </web-resource-collection>
  <user-data-constraint>
    <description>No Description</description>
    <transport-guarantee>NONE</transport-guarantee>
  </user-data-constraint>
</security-constraint>

<security-constraint>
  <web-resource-collection>
    <web-resource-name>httpspages</web-resource-name>
    <description>No Description</description>
    <url-pattern>*.jsp</url-pattern>
  </web-resource-collection>
  <user-data-constraint>
    <description>No Description</description>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
  </user-data-constraint>
</security-constraint>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM