Web application using JBoss 4.0.3SP1 and servlets.
I am using FORM authentication. Can username be UTF-8?
I create an account, its username is in UTF-8 encoding, chinese characters.
But login was not successful. Can JBoss built-in authentication handle UTF-8
encoding for username?
Ascii username works.
I tried to use a filter to set request encoding to UTF-8, but the filter was
not called for URL pattern "j_security_check".
<filter-mapping>
<filter-name>filter</filter-name>
<url-pattern>/j_security_check</url-pattern>
</filter-mapping>
Right now I am using a filter to set request encoding to UTF-8 for all requests
in order to support chinese characters. It works great except Form login. The
username is created in UTF-8 and stored in database.
The related part in login-config.xml
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
flag="required">
<module-option name="dsJndiName">java:/DefaultDS</module-option>
<module-option name="principalsQuery">
select password from User where username=?
</module-option>
So I suspect the FORM login need to go through a filter to set its encoding to
UTF-8. Otherwise, the server side would assume iso-8859-1 encoding, and it
would not find the username in database table. Is there a way to tell Web
Container about the request encoding?
Thanks for help. Have a nice day!
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.