2014-10-01 66 views
0

我有一個WebApplication,我想用安全約束保護web.xmlJetty 9刪除URI碎片

這裏loginConfig從web.xml

<login-config> 
    <auth-method>FORM</auth-method> 
    <realm-name>MyUserRealm</realm-name> 
    <form-login-config> 
     <form-login-page>/login/login.html</form-login-page> 
     <form-error-page>/login/login-error.html</form-error-page> 
    </form-login-config> 
</login-config> 

而且這裏的安全約束:

<security-constraint> 
    <web-resource-collection> 
     <web-resource-name>Public</web-resource-name> 
     <url-pattern>/login/*</url-pattern> 
    </web-resource-collection> 
    <user-data-constraint> 
     <transport-guarantee>NONE</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 
<security-constraint> 
    <web-resource-collection> 
     <web-resource-name>Private</web-resource-name> 
     <url-pattern>/*</url-pattern> 
    </web-resource-collection> 
    <auth-constraint> 
     <role-name>**</role-name> 
    </auth-constraint> 
    <user-data-constraint> 
     <transport-guarantee>NONE</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

這工作得很好,我重定向到所需的login.html網站,我可以正確驗證自己。 的login.html是這樣的:

<form method="post" action="/j_security_check" id="loginform"> 
    <input class="login" value="" name="j_username" maxlength="25" type="text" placeholder="Username" required/> 
    <input class="login" value="" name="j_password" maxlength="25" type="password" placeholder="Password" required/> 
    <input name="submit" type="submit" value="Login" /> 
</form> 

我現在的問題是,我使用的原始URL的URI片段被轉發到登錄網站,但認證後不包括回原來的站點。因爲這樣我會丟失所有我想要在WebApp中檢查的碎片和參數。

任何人都知道爲什麼URI-Fragments被刪除?

回答