You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Philippe Daucourt (JIRA)" <de...@myfaces.apache.org> on 2006/03/20 14:37:59 UTC

[jira] Resolved: (TOMAHAWK-204) JspTilesViewHandlerImpl create view for CSS external files () and it causes problem in forms containing input elements with non-ascii caracters entered

     [ http://issues.apache.org/jira/browse/TOMAHAWK-204?page=all ]
     
Philippe Daucourt  resolved TOMAHAWK-204:
-----------------------------------------

    Resolution: Fixed

It is not a problem of MyFaces. 

The problem occurs when an external resource (css or image) is declared without a trailing "/" (context relative resource).

For example, in my case: <link rel="stylesheet" href=css/default.css" type="text/css"/>

When you use url-mapping /faces/* for JSP to be handled by Faces Servlet, the url for my CSS become during runtime /myContext/faces/css/default.css. So, the CSS is handled by Faces Servlet and it's normal that JspTilesViewHandlerImpl receives it and tries to create a view.

I have resolved my problem using trailing "/" for all my external resources.


> JspTilesViewHandlerImpl create view for CSS external files (<link></link>) and it causes problem in forms containing input elements with non-ascii caracters entered
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: TOMAHAWK-204
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-204
>      Project: MyFaces Tomahawk
>         Type: Bug
>   Components: Tiles
>     Versions: 1.1.1
>  Environment: Linux, MyFaces 1.1.1, JDK 1.5, Tomcat 5.5
>     Reporter: Philippe Daucourt 
>      Fix For: 1.1.1

>
> Strangely, JspTilesViewHandler tries to create a view for CSS external file (<link></link>). This behavior causes a problem with InputForm and InputText with non-ascii caracters entered (éàè for example). For example, if I enter "bébé" I get "bébé" after postback of the form.
> If I delete my external link for my CSS, everything works fine.
> I'm quite sure it is not an encoding problem. I have tried to use "accept" and "enctyp" for the form. I have set the encoding of my JSP (<%@ page contentType="text/html;charset=UTF-8" language="java" %>) and I have set the html head with content-type (<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8"/>) but without any success. Only the deletion of the external CSS works to solve the problem.
> Below is the logging output (first with CSS, second without CSS)
> First call:
> 2006-03-20 11:59:59 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request
> 2006-03-20 11:59:59 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /test1.jsp
> 2006-03-20 11:59:59 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - JspTilesViewHandlerImpl init
> 2006-03-20 11:59:59 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - Reading tiles definitions
> 2006-03-20 12:00:00 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - Dispatching to /mainLayout.jsp
> 2006-03-20 12:00:04 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request
> 2006-03-20 12:00:04 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /css/default.css
> 2006-03-20 12:00:04 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - Dispatching to /css/default.css
> Postback:
> 2006-03-20 12:00:10 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - Tree structure restored from client request
> 2006-03-20 12:00:10 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - Dispatching to /mainLayout.jsp
> 2006-03-20 12:00:10 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request
> 2006-03-20 12:00:10 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /css/default.css
> 2006-03-20 12:00:10 [http-8084-Processor22] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - Dispatching to /css/default.css
> First call:
> 2006-03-20 11:58:10 [http-8084-Processor20] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request
> 2006-03-20 11:58:10 [http-8084-Processor20] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /test1.jsp
> 2006-03-20 11:58:10 [http-8084-Processor20] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - Dispatching to /mainLayout.jsp
> Postback:
> 2006-03-20 11:58:15 [http-8084-Processor20] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - Tree structure restored from client request
> 2006-03-20 11:58:15 [http-8084-Processor20] DEBUG org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl - Dispatching to /mainLayout.jsp

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira