You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volodymyr Siedlecki (Jira)" <de...@myfaces.apache.org> on 2022/11/14 16:55:00 UTC
[jira] [Commented] (MYFACES-4498) TCK: Issue 4345 : Head Element Not Updated As Expected via Ajax Call
[ https://issues.apache.org/jira/browse/MYFACES-4498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17633937#comment-17633937 ]
Volodymyr Siedlecki commented on MYFACES-4498:
----------------------------------------------
I've attached the Mojarra app from the TCK.
> TCK: Issue 4345 : Head Element Not Updated As Expected via Ajax Call
> --------------------------------------------------------------------
>
> Key: MYFACES-4498
> URL: https://issues.apache.org/jira/browse/MYFACES-4498
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 4.0.0-RC2
> Reporter: Volodymyr Siedlecki
> Priority: Major
> Attachments: test-faces22-ajax.war
>
>
> Test Code:
> [https://github.com/jakartaee/faces/blob/4.0.1/tck/faces22/ajax/src/test/java/ee/jakarta/tck/faces/test/servlet30/ajax/Issue4345IT.java#L47]
> [https://github.com/jakartaee/faces/blob/4.0.1/tck/faces22/ajax/src/main/webapp/issue4345result.xhtml]
> [https://github.com/jakartaee/faces/blob/4.0.1/tck/faces22/ajax/src/test/java/ee/jakarta/tck/faces/test/servlet30/ajax/Issue4345IT.java#L47]
> This test was created for ensure HTML is only escaped twice ([Issue 4345|https://github.com/eclipse-ee4j/mojarra/issues/4345). However, MyFaces is encountering two problems with this test.
> Firstly, here is the Ajax response and the updated HTML:
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <partial-response id="j_id__v_0">
> <changes>
> <update id="jakarta.faces.ViewRoot">
> <![CDATA[<!--
> Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
>
> This program and the accompanying materials are made available under the
> terms of the Eclipse Public License v. 2.0, which is available at
> http://www.eclipse.org/legal/epl-2.0.
>
> This Source Code may also be made available under the following Secondary
> Licenses when the conditions for such availability set forth in the
> Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
> version 2 with the GNU Classpath Exception, which is available at
> https://www.gnu.org/software/classpath/license.html.
>
> SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
>
> --><!DOCTYPE html>
> <html xmlns="http://www.w3.org/1999/xhtml"><head>
> <!-- h:outputStylesheet does not support params in the URL, so generate a similar link manually. -->
> <!--<h:outputStylesheet name="issue4345.css?firstParam=1&secondParam=2" />-->
> <link type="text/css" rel="stylesheet" href="/test-faces22-ajax/jakarta.faces.resource/issue4345.css.xhtml?firstParam=1&secondParam=2" /><script type="text/javascript" src="/test-faces22-ajax/jakarta.faces.resource/issue4345.js.xhtml?firstParam=1&secondParam=2"></script></head><body></body>
> </html>]]>
> </update>
> <update id="j_id__v_0:jakarta.faces.ViewState:1">
> <![CDATA[ZmY2MjMxN2MxYTY3OTg1MTAwMDAwMDA0]]>
> </update>
> </changes>
> </partial-response> {code}
> The HTML is then set as :
> {code:java}
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <style rel="stylesheet" type="text/css">@import url('/test-faces22-ajax/jakarta.faces.resource/issue4345.css.xhtml?firstParam=1&secondParam=2');</style>
> </head>
> <body></body>
> </html>
> {code}
> 1) We change from a link (type/css ) to a style tag that imports the URL? Should that occur? The JavaScript in issue4345result.xhtml specifically looks for a link element.
> 2) The script tags *are not appended* to the head element, but I do see network requests for them. Additionally, the scripts do run (confirmed by the console: "issue4345.js loaded." ).
> This fails on both the RC2 scripts and the new TypeScript code.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)