Dave- I believe you can effect this encoding if you specify encoding="UTF-8" in the xml element e.g. <?xml version="1.0" encoding="UTF-8"?>
I am not aware of CJK implementations that use UTF-8 ..you may want to consider UTF-16 Scott does this look ok? HTH, Martin- ----- Original Message ----- From: "Dave" <[EMAIL PROTECTED]> To: <users@tomcat.apache.org> Sent: Thursday, March 02, 2006 12:02 PM Subject: Form login UTF-8 username problem > 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.