Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 79903 invoked from network); 24 Mar 2008 18:39:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Mar 2008 18:39:33 -0000 Received: (qmail 31634 invoked by uid 500); 24 Mar 2008 18:39:30 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 31595 invoked by uid 500); 24 Mar 2008 18:39:30 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 31584 invoked by uid 99); 24 Mar 2008 18:39:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Mar 2008 11:39:30 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Mar 2008 18:38:59 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 00B36234C0AC for ; Mon, 24 Mar 2008 11:37:28 -0700 (PDT) Message-ID: <558721027.1206383848001.JavaMail.jira@brutus> Date: Mon, 24 Mar 2008 11:37:28 -0700 (PDT) From: "Scott O'Bryan (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Commented: (MYFACES-1841) HtmlResponseWriterImpl.writeURIAttribute does not perform proper URLs encoding ( ex: & should be encoded in &) In-Reply-To: <1245710571.1206302965574.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MYFACES-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581633#action_12581633 ] Scott O'Bryan commented on MYFACES-1841: ---------------------------------------- Makes sense to me. Seems to be something that the TCK should have caught though... > HtmlResponseWriterImpl.writeURIAttribute does not perform proper URLs encoding ( ex: & should be encoded in &) > ------------------------------------------------------------------------------------------------------------------ > > Key: MYFACES-1841 > URL: https://issues.apache.org/jira/browse/MYFACES-1841 > Project: MyFaces Core > Issue Type: Bug > Components: General, Portlet_Support > Affects Versions: 1.1.4, 1.1.5, 1.2.0 > Environment: Windows xp sp2->Jboss portal 2.4.2->tomcat 5.5 ->JSF portlet > Reporter: Lorenzo Cerulli > > HtmlFormRenderer is the class in charge of rendering the UIForm component and all the required attibutes. > This class is in charge of rendering for example the Form component tinto
> During the rendering process the form renderer uses HtmlResponseWriterImpl.writeURIAttribute to write the "action" attribute of the form component. > Generally speaking the action attribute should be acquired using "context.getApplication().getViewHandler().getActionURL(context, viewid))" and the result MUST be encoded using "context.getExternalContext().encodeActionURL" before passing the url to the "HtmlResponseWriterImpl.writeURIAttribute(URL);" This way the URL will be well formed and will be correctly encoded in the action attribute. > Even if the HtmlFormRendererBase for example correctly implements this process the resulting URL is encoded in the action attribute without correctly transforming "&" in "&". > At this point we can argue that this bug could be generated by two different sources: > 1. Not correct URL encding perfomed by javax.faces.context.FacesContext during context.getExternalContext().encodeActionURL[this is non related to myfaces and probably depend on the PortletResponse object implemented by the container JBOSS portal in this case] > 2. Nor correct URI encoding within HtmlResponseWriterImpl.writeURIAttribute(URL) [related to myfaces] > Analyzing the source code of the latter i noticed that writeURIAttribute(URL) internally calls the HTMLEncoder.encode method to perform string encoding if the URI starts with the "javascript" prefix otherwise does not perform any kind of encoding. > Probably this is a bug bacause an enforcment of URI encoding rules should be provided in any case; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.