當我使用HTTPS登錄頁面上我的網站的春天安全方面向前邁進使用錯誤的端口:春季安全的Https錯誤的端口
我登錄豆執行以下操作:
ExternalContext ec = context.getExternalContext();
String encodedURL = ec.encodeResourceURL(ec.getRequestContextPath() + "/j_spring_security_check?j_username=" + userId + "&j_password=" + password + "&_spring_security_remember_me=" + rememberMe);
logger.info(encodedURL);
ec.redirect(encodedURL);
也試過:
ExternalContext context = FacesContext.getCurrentInstance()
.getExternalContext();
RequestDispatcher dispatcher = ((ServletRequest) context.getRequest())
.getRequestDispatcher("/j_spring_security_check");
dispatcher.forward((ServletRequest) context.getRequest(),
(ServletResponse) context.getResponse());
FacesContext.getCurrentInstance().responseComplete();
// It's OK to return null here because Faces is just going to exit.
return null;
server.xml中:
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
<Connector port="443" protocol="HTTP/1.1" scheme="https" secure="true"/>
不知道爲什麼它使用了錯誤的端口...
我這樣做... HTTPS和HTTP工作正常。它只是j_spring_security_check的登錄頁面,似乎沒有工作......它似乎試圖重定向到端口80上的HTTPS頁面出於某種原因。 –