[ 
https://issues.apache.org/jira/browse/MYFACES-1814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568543#action_12568543
 ] 

Curtiss Howard commented on MYFACES-1814:
-----------------------------------------

I believe MyFaces is doing the correct thing in regards to parsing the charset 
out of the Content-Type header.  Parameters (e.g., "charset=UTF-8") for media 
types are defined in section 3.6 of RFC2616 (HTTP/1.1) as being:

attribute "=" value

The spec does not indicate that any delimiter besides "=" can be used and thus 
I would argue that the application needs to be changed to be in line with 
accepted standards.

> be more tolerant and also parse "charset:UTF-8" in addition to "charset=UTF-8"
> ------------------------------------------------------------------------------
>
>                 Key: MYFACES-1814
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1814
>             Project: MyFaces Core
>          Issue Type: Wish
>          Components: General
>    Affects Versions: 1.2.2
>         Environment: MyFaces 1.2.2 on Tomcat 6.0.13
>            Reporter: Inturico Engineering
>            Priority: Minor
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> In our log file, I see stack traces like
> "
> SEVERE: Servlet.service() for servlet FacesServlet threw exception
> java.io.UnsupportedEncodingException: charset:UTF-8
>       at java.lang.StringCoding.decode(StringCoding.java:170)
>       at java.lang.String.<init>(String.java:444)
>       at java.lang.String.<init>(String.java:516)
>       at 
> org.apache.catalina.connector.Request.setCharacterEncoding(Request.java:1478)
>       at 
> org.apache.catalina.connector.RequestFacade.setCharacterEncoding(RequestFacade.java:307)
>       at 
> javax.servlet.ServletRequestWrapper.setCharacterEncoding(ServletRequestWrapper.java:113)
>       at 
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.setRequestCharacterEncoding(ServletExternalContextImpl.java:445)
>       at javax.faces.application.ViewHandler.initView(ViewHandler.java:92)
>       at 
> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:61)
>       at 
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
>       at 
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>       at 
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
>       at 
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:447)
>       at 
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
>       at 
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
>       at 
> org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:424)
>       at 
> org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
>       at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
>       at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>       at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>       at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
>       at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
>       at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
>       at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
>       at 
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
>       at 
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
>       at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:686)
>       at java.lang.Thread.run(Thread.java:619)
> "
> The culprit is the system requesting "charset:UTF-8" instead of 
> "charset=UTF-8".  Nevertheless, it may make sense for the 
> calculateCharacterEncoding method in the ViewHandler class to not only parse 
> "="s but also ":"s.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to