Re: character encoding, JAAS, servlet filter vs. valve
Adam Hardy wrote: I can't see why. Perhaps you are overriding it later in the request processing? Struts uses response.setContentType() The docs say: overridden automatically if a * codeRequestDispatcher.forward()/code call is * ultimately invoked. but that leaves me none the wiser. Possible. I'm not that deep in the servlet processes, don't know what strange things are done. (I come from the Cocoon world and I'm afraid from the low abstraction in general ;-) ). But not the problem, we set the content type in one JSP that is included in every other JSP, so we have to maintain this also on one place only. Joerg Adam On 09/23/2003 03:25 PM Joerg Heinicke wrote: Joerg Heinicke wrote: I found http://jakarta.apache.org/struts/api/org/apache/struts/config/ControllerConfig.html#contentType and set the contentType in the struts-config.xml with controller contentType=text/html;charset=UTF-8/. Does not work as expected. Mozilla recognizes the pages know as ISO-8859-1 and no longer UTF-8. Joerg -- System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 [EMAIL PROTECTED] www.virbus.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: character encoding, JAAS, servlet filter vs. valve
Adam Hardy wrote: albeit - does not sound very English, but my dictionary knows it :-) Pronounced all - be - it which makes it sounds like 3 seperate but very english words. Never did know what it meant. Did I use it correctly? 8-) At least the translation in my dictionary makes sense :-P This becomes off topic now ... Joerg -- System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 [EMAIL PROTECTED] www.virbus.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: character encoding, JAAS, servlet filter vs. valve
Well post a message if you manage to sort it out. I now wasting time trying to get emacs to work with unicode, but when I've done that, I'll should be able to try out the same thing as you. The way I see it, as long as the html login page going out to the browser has character-encoding set to UTF-8, then there are no processes between form submit and the redisplay of the login name which would change its encoding. The string goes thro the http request, into tomcat, into struts action form and then back out into the html page again. I'll soon see I guess. Adam On 09/24/2003 01:31 PM Joerg Heinicke wrote: Adam Hardy wrote: I can't see why. Perhaps you are overriding it later in the request processing? Struts uses response.setContentType() The docs say: overridden automatically if a * codeRequestDispatcher.forward()/code call is * ultimately invoked. but that leaves me none the wiser. Possible. I'm not that deep in the servlet processes, don't know what strange things are done. (I come from the Cocoon world and I'm afraid from the low abstraction in general ;-) ). But not the problem, we set the content type in one JSP that is included in every other JSP, so we have to maintain this also on one place only. Joerg Adam On 09/23/2003 03:25 PM Joerg Heinicke wrote: Joerg Heinicke wrote: I found http://jakarta.apache.org/struts/api/org/apache/struts/config/ControllerConfig.html#contentType and set the contentType in the struts-config.xml with controller contentType=text/html;charset=UTF-8/. Does not work as expected. Mozilla recognizes the pages know as ISO-8859-1 and no longer UTF-8. Joerg -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
character encoding, JAAS, servlet filter vs. valve
Hello, we have a Struts web application, that should use UTF-8 as character encoding. I set the content type for the HTML pages (JSP) as well as the character encoding on the request via the SetCharacterEncodingFilter delivered with Tomcat in the examples webapp. It works in the whole application. But: It's Tomcat 4.1.18 integrated in JBoss 3.0.6 and we do authentication using JAAS and I found no possibility to set the request encoding of the JAAS request (to j_security_check). This resulted in wrong username or password for müller, which could be fixed in the login module by recoding the string. But we also have a logged in as on every page and there was not written müller, but the infamous UTF-8 vs. ISO-8859 mA¼ller, because it was wrongly set on the request object or at least wrongly read from there. I have fixed it by writing a SetCharacterEncodingValve and now also the JAAS request is handled as UTF-8, but the application depends on Tomcat now. Does anybody know how to configure the filter mapping to match also the JAAS request? As far as I know the JAAS request is catched by the servlet container and does not arrive at the web app. This means the filter mapping in the web.xml can't be read/used. I would like to replace the Valve with the Filter to avoid servlet container dependency. I appreciate any help. Regards, Joerg -- System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 [EMAIL PROTECTED] www.virbus.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: character encoding, JAAS, servlet filter vs. valve
Hi Joerg, since you are using struts, why don't you ditch the SetCharacterEncodingFilter and set the character-encoding as a property of the struts controller? This means you also don't need anything in your JSPs. I assume you are using form-based container-managed authentication as the interface to the JAAS realm. If so, I do not understand how you have a character encoding problem with the login form, since you can just set the character encoding in the JSP as a scriptlet or in HTML as a meta tag. I stand a few days away from setting up the same configuration myself, albeit without JBoss, so I would be interested in your reply. HTH, Adam On 09/23/2003 11:01 AM Joerg Heinicke wrote: Hello, we have a Struts web application, that should use UTF-8 as character encoding. I set the content type for the HTML pages (JSP) as well as the character encoding on the request via the SetCharacterEncodingFilter delivered with Tomcat in the examples webapp. It works in the whole application. But: It's Tomcat 4.1.18 integrated in JBoss 3.0.6 and we do authentication using JAAS and I found no possibility to set the request encoding of the JAAS request (to j_security_check). This resulted in wrong username or password for müller, which could be fixed in the login module by recoding the string. But we also have a logged in as on every page and there was not written müller, but the infamous UTF-8 vs. ISO-8859 mA¼ller, because it was wrongly set on the request object or at least wrongly read from there. I have fixed it by writing a SetCharacterEncodingValve and now also the JAAS request is handled as UTF-8, but the application depends on Tomcat now. Does anybody know how to configure the filter mapping to match also the JAAS request? As far as I know the JAAS request is catched by the servlet container and does not arrive at the web app. This means the filter mapping in the web.xml can't be read/used. I would like to replace the Valve with the Filter to avoid servlet container dependency. I appreciate any help. Regards, Joerg -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: character encoding, JAAS, servlet filter vs. valve
Adam Hardy wrote: Hi Joerg, since you are using struts, why don't you ditch the SetCharacterEncodingFilter and set the character-encoding as a property of the struts controller? This means you also don't need anything in your JSPs. Ah, okay. It's our first Struts project and experience. I found http://jakarta.apache.org/struts/api/org/apache/struts/config/ControllerConfig.html#contentType and set the contentType in the struts-config.xml with controller contentType=text/html;charset=UTF-8/. But as written at the above link this option sets only the content type and character encoding ... on each response. This means it does not handle/influence the request character encoding. I assume you are using form-based container-managed authentication as the interface to the JAAS realm. If so, I do not understand how you have a character encoding problem with the login form, since you can just set the character encoding in the JSP as a scriptlet or in HTML as a meta tag. Yes, it's a simple HTML form, the page is in UTF-8 (Mozilla View Page Info), so that's ok. But again this is only server response. The next request is then sent in UTF-8, but the server does not know how to handle it, the character encoding is null. It assumes default encoding which should be ISO-8859-1. Setting the character encoding to UTF-8 makes the server understanding the request. I stand a few days away from setting up the same configuration myself, albeit without JBoss, so I would be interested in your reply. albeit - does not sound very English, but my dictionary knows it :-) Joerg On 09/23/2003 11:01 AM Joerg Heinicke wrote: Hello, we have a Struts web application, that should use UTF-8 as character encoding. I set the content type for the HTML pages (JSP) as well as the character encoding on the request via the SetCharacterEncodingFilter delivered with Tomcat in the examples webapp. It works in the whole application. But: It's Tomcat 4.1.18 integrated in JBoss 3.0.6 and we do authentication using JAAS and I found no possibility to set the request encoding of the JAAS request (to j_security_check). This resulted in wrong username or password for müller, which could be fixed in the login module by recoding the string. But we also have a logged in as on every page and there was not written müller, but the infamous UTF-8 vs. ISO-8859 mA¼ller, because it was wrongly set on the request object or at least wrongly read from there. I have fixed it by writing a SetCharacterEncodingValve and now also the JAAS request is handled as UTF-8, but the application depends on Tomcat now. Does anybody know how to configure the filter mapping to match also the JAAS request? As far as I know the JAAS request is catched by the servlet container and does not arrive at the web app. This means the filter mapping in the web.xml can't be read/used. I would like to replace the Valve with the Filter to avoid servlet container dependency. I appreciate any help. Regards, Joerg -- System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 [EMAIL PROTECTED] www.virbus.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: character encoding, JAAS, servlet filter vs. valve
Joerg Heinicke wrote: I found http://jakarta.apache.org/struts/api/org/apache/struts/config/ControllerConfig.html#contentType and set the contentType in the struts-config.xml with controller contentType=text/html;charset=UTF-8/. Does not work as expected. Mozilla recognizes the pages know as ISO-8859-1 and no longer UTF-8. Joerg -- System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 [EMAIL PROTECTED] www.virbus.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: character encoding, JAAS, servlet filter vs. valve
I can't see why. Perhaps you are overriding it later in the request processing? Struts uses response.setContentType() The docs say: overridden automatically if a * codeRequestDispatcher.forward()/code call is * ultimately invoked. but that leaves me none the wiser. Adam On 09/23/2003 03:25 PM Joerg Heinicke wrote: Joerg Heinicke wrote: I found http://jakarta.apache.org/struts/api/org/apache/struts/config/ControllerConfig.html#contentType and set the contentType in the struts-config.xml with controller contentType=text/html;charset=UTF-8/. Does not work as expected. Mozilla recognizes the pages know as ISO-8859-1 and no longer UTF-8. Joerg -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: character encoding, JAAS, servlet filter vs. valve
On 09/23/2003 03:20 PM Joerg Heinicke wrote: Ah, okay. It's our first Struts project and experience. I found http://jakarta.apache.org/struts/api/org/apache/struts/config/ControllerConfig.html#contentType and set the contentType in the struts-config.xml with controller contentType=text/html;charset=UTF-8/. But as written at the above link this option sets only the content type and character encoding ... on each response. This means it does not handle/influence the request character encoding. I have successfully ignored character-encoding on the request until this point. I am going to have read up about how java knows the difference between UTF-8 and single-byte character sets. albeit - does not sound very English, but my dictionary knows it :-) Pronounced all - be - it which makes it sounds like 3 seperate but very english words. Never did know what it meant. Did I use it correctly? 8-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]