0
我有一个WebApplication,我想用安全约束保护web.xml
。Jetty 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被删除?