使用过滤器从 HTTPS 重定向到 HTTP
我的应用程序中有几个页面在 https://localhost:8181 上运行,并且有几个页面在 http://localhost:8080.I 想从 https 降级到 http,但不知道如何去做。我知道我有使用过滤器来管理从 https 到的重定向http 和 http 到 https。
我查看了此链接 [How to downshift from HTTPS to HTTP in your web application][1]
[1]: https://blogs.oracle.com/jluehe/entry/how_to_downshift_from_https 但是使用过滤器的链接已损坏..我没有关于过滤器内部应该做什么的清晰想法...
在我的 web.xml 中`
<filter>
<filter-name>Non SSL port</filter-name>
<filter-class>SSLFilter</filter-class>
<init-param>
<param-name>httpPort</param-name>
<param-value>8080</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>NON SSL pages</filter-name>
<url-pattern>/pages/success.xhtml</url-pattern>
<url-pattern>/pages/failure.xhtml</url-pattern>
<url-pattern>/pages/about.xhtml</url-pattern>
</filter-mapping>`
可以有人指导我过滤器内部需要做什么,以便 https 到 http 之间的转换顺利。
我正在使用 Glassfish 3.1.1 和 JSF。
I have few pages in my application which run on https://localhost:8181 and few pages which run on http://localhost:8080.I want to downshift from https to http but not sure how to go about it.I know I have to use filter which manages the redirection from https to http and http to https.
I looked into this link [How to downshift from HTTPS to HTTP in your web application][1]
[1]: https://blogs.oracle.com/jluehe/entry/how_to_downshift_from_https but the link where the filters s used are broken..I do not have a clear idea as to what is supposed to be done inside the filters...
In my web.xml `
<filter>
<filter-name>Non SSL port</filter-name>
<filter-class>SSLFilter</filter-class>
<init-param>
<param-name>httpPort</param-name>
<param-value>8080</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>NON SSL pages</filter-name>
<url-pattern>/pages/success.xhtml</url-pattern>
<url-pattern>/pages/failure.xhtml</url-pattern>
<url-pattern>/pages/about.xhtml</url-pattern>
</filter-mapping>`
CAn some one guide me what needs to be done inside the filter so that the shifting between https to http is smooth.
I am using Glassfish 3.1.1 and JSF.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)