【发布时间】:2026-02-18 17:40:01
【问题描述】:
我们正在将 GWT 应用程序部署到 Wildly 8.1.0 服务器,并使用表单身份验证来确保安全。我们的问题是,每次我们的客户在其用户名或密码中包含特殊字符(æøåäëö 等)时,他们都无法登录。
我看到其他人有同样的问题:
https://developer.jboss.org/thread/42859?tstart=0
UTF-8 encoded j_security_check username incorrectly decoded as Latin-1 in Tomcat realm
Spring security: Form login special characters
但他们使用的是 Tomcat/Apache/Spring 等,所以我很难找到适合我们设置的解决方案。
Wildly/Undertow 是否有任何配置参数,以便我们在用户登录时确保 UTF-8 编码?
我们的 web.xml:
<login-config>
<auth-method>FORM</auth-method>
<realm-name>project-security-policy</realm-name>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
登录表单:
<form name="loginform" method="post" autocomplete="on" action="j_security_check" accept-charset="UTF-8 ISO-8859-1" onsubmit="return validate_login_form();">
<input id="usernameInput" name="j_username" class="form-input" type="text" placeholder="Username" autofocus="">
<input id="passwordInput" name="j_password" class="form-input" type="password" placeholder="Password">
<input id="submitButton" type="submit" value="Login">
</form>
【问题讨论】:
标签: jakarta-ee ejb wildfly wildfly-8 form-authentication