2010-05-04 58 views

回答

0

我們需要在配置中進一步添加一個過濾器。
check it here

0

在你的web.xml:

<security-constraint> 
    <display-name>Security Settings</display-name> 
    <web-resource-collection> 
     <web-resource-name>SSL Pages</web-resource-name> 
     <description/> 
     <url-pattern>/*.jsp</url-pattern> 
     <http-method>GET</http-method> 
     <http-method>POST</http-method> 
    </web-resource-collection> 
    <user-data-constraint> 
     <description>CONFIDENTIAL requires SSL</description> 
     <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

變化,無論你需要的URL模式。

+0

我想,當服務器服務secure.html頁,我想協議,可以自動爲「https」從http 我對HTTPS配置GlassFish和也在web.xml 上述結構添加,但它檢索僅在http中的頁面。 – 2010-05-04 08:45:40

+0

也使用HTTP用戶不應該能夠訪問受保護 – 2010-05-04 10:00:26

+0

頁我的SSL端口爲8080 增加8181 普通端口的HTTP listener1 重定向端口= 8181仍然沒有重定向到HTTPS – 2010-05-04 12:51:59