[jboss-jira] [JBoss JIRA] Updated: (JBPORTAL-1550) charset encoding with commons-fileupload-1.1.1
Luca Stancapiano (JIRA)
jira-events at lists.jboss.org
Mon Jul 9 11:29:36 EDT 2007
[ http://jira.jboss.com/jira/browse/JBPORTAL-1550?page=all ]
Luca Stancapiano updated JBPORTAL-1550:
---------------------------------------
Attachment: CMSAdminPortlet.java
I send you the entire patched CMSAdminPortlet
> charset encoding with commons-fileupload-1.1.1
> ----------------------------------------------
>
> Key: JBPORTAL-1550
> URL: http://jira.jboss.com/jira/browse/JBPORTAL-1550
> Project: JBoss Portal
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Portal CMS
> Affects Versions: 2.6 Final
> Environment: JBoss as from http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_4_0_5_GA_CP06,
> JBoss Portal from http://anonsvn.jboss.org/repos/portal/trunk since 9 july 2007
> Reporter: Luca Stancapiano
> Assigned To: Sohil Shah
> Fix For: 2.6.1 Final
>
> Attachments: CMSAdminPortlet.java
>
>
> there is a problem in the portal using commons-fileupload 1.1.1 libs because this lib isn't compatible 100% with current version of tomcat (5.5.23) into jboss 4.0.5. When org.jboss.portal.core.cms.ui.admin.CMSAdminPortlet class try to use getString() method of org.apache.commons.fileupload.disk.DiskFileItem class, it try to get the default character encoding from header into InputStream of HttpServletRequest. But tomcat 5.5.23 splits header from InputStream. Header of request can to be taken only through getHeader() method of HttpServletRequest and since upper commons-fileupload 1.0 libs it is not done. The result is that , using getString() method, you don't use UTF-8 character encoding and in many cases you cannot decode the item. In my case I try to pass characters as à, è, ì, ò, ù and I see bad characters as results. Instead to back to commons-fileuload-1.0 libs,the simpliest solution for this problem is to pass the charset encoding to getString method in this manner:
> org.jboss.portal.core.cms.ui.admin.CMSAdminPortlet : row 951
> if ("destination".equals(fieldName))
> {
> sPath = item.getString(aReq.getCharacterEncoding());
> }
> instead of:
> if ("destination".equals(fieldName))
> {
> sPath = item.getString();
> }
> so it is ok
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list