[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17752075#comment-17752075 ] Thomas Andraschko edited comment on MYFACES-4536 at 8/8/23 2:38 PM: [~melloware] is there anything to do here in MF? ITs are running fine since we removed 2.2 and the old constructor in PF? was (Author: tandraschko): [~melloware] is there anything to do here in MF? ITs are running fine since we removed 2.2 and the old constructor? > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Melloware >Priority: Major > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17753332#comment-17753332 ] Werner Punz edited comment on MYFACES-4536 at 8/11/23 7:45 PM: --- This is indeed a bug in myfaces, the response eval section is perfectly valid within the spec! It definitely should not be gone! Good question where this happens, it basically can only happen within the response writer! I do not remember why the double buffering was added, this was a long time ago. But it should not make a difference! So if it happens there it definitely is a bug. was (Author: werpu): This is indeed a bug in myfaces, the response eval section is perfectly valid within the spec! It definitely should not be gone! > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17756573#comment-17756573 ] Werner Punz edited comment on MYFACES-4536 at 8/20/23 7:38 PM: --- Ok... the double buffering was there for only one reason, if you have a CDATA element with some embedded CDATA in (AKA hosting another CDATA element for instance in some embedded html like update etc...) it runs another encoding step to get this out aka
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17756573#comment-17756573 ] Werner Punz edited comment on MYFACES-4536 at 8/20/23 7:38 PM: --- Ok... the double buffering was there for only one reason, if you have a CDATA element with some embedded CDATA in (AKA hosting another CDATA element for instance in some embedded html like update etc...) it runs another encoding step to get this out. This is valid behavior in a sense that html code can embed javascript (there is an internal parsing step on the client side to cover this case) And a valid usecase to define a script block is
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17756573#comment-17756573 ] Werner Punz edited comment on MYFACES-4536 at 8/20/23 7:38 PM: --- Ok... the double buffering was there for only one reason, if you have a CDATA element with some embedded CDATA in (AKA hosting another CDATA element for instance in some embedded html like update etc...) it runs another encoding step to get this out aka
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17770702#comment-17770702 ] Thomas Andraschko edited comment on MYFACES-4536 at 9/30/23 12:13 PM: -- [~melloware] can you try to add a unittest here in MF? I can also have a look then. was (Author: tandraschko): [~melloware] can you try to add a unittest here in MF? > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771165#comment-17771165 ] Werner Punz edited comment on MYFACES-4536 at 10/2/23 3:31 PM: --- Hi I have started to look into it now, its been a while since I looked into it, but the problem maybe related to the xml filter public PartialResponseWriterImpl(ResponseWriter writer) { super(writer.cloneWithWriter(new IllegalXmlCharacterFilterWriter(writer))); } Which in itself fixes another issue which myfaces had with illegal characters. I will post info when I know more of the real cause. As for the double buffering response writer, I think it has to do with the problem that if you embed cdata into cdata you have the "escape" it by splitting it into several cdata sections. Hence this probably was done this way. But all of this atm is just guessing! I will debug this out tonight! To get a better idea what is happening! was (Author: werpu): Hi I have started to look into it now, its been a while since I looked into it, but the problem maybe related to the xml filter public PartialResponseWriterImpl(ResponseWriter writer) { super(writer.cloneWithWriter(new IllegalXmlCharacterFilterWriter(writer))); } Which in itself fixes another issue which myfaces had with illegal characters. I will post info when I know more of the real cause. > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771238#comment-17771238 ] Werner Punz edited comment on MYFACES-4536 at 10/2/23 6:21 PM: --- I think the main difference really is the wrapped here, let me try a test! was (Author: werpu): In my opinion the problem lies more on the way the response writer chain is constructed, the way the writers are generated is that they are passed down and cloned. > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771243#comment-17771243 ] Werner Punz edited comment on MYFACES-4536 at 10/2/23 6:33 PM: --- The behavior itself works: [https://gist.github.com/werpu/3d3fdeaa8e75336f7aa5b63bd480b04c] This test passes, so yes, the problem is not in the writer itself or the partial response writer, so yes the csp response writer might be the culprit here or another one in the chain: !image-2023-10-02-20-33-05-162.png|width=435,height=72! was (Author: werpu): The behavior itself works: [https://gist.github.com/werpu/3d3fdeaa8e75336f7aa5b63bd480b04c] This test passes, so yes, the problem is not in the writer itself or the partial response writer: !image-2023-10-02-20-33-05-162.png|width=435,height=72! > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, image-2023-10-02-20-33-05-162.png, > mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771339#comment-17771339 ] Werner Punz edited comment on MYFACES-4536 at 10/3/23 5:35 AM: --- [~melloware] could you make it work, if not then I have to look into the other responsewriters, to find which one is at culprit here! was (Author: werpu): [~melloware] could you make it work, if not then I have to look into the other responsewriters, to find which one is at culprit here? > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, image-2023-10-02-20-33-05-162.png, > mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771339#comment-17771339 ] Werner Punz edited comment on MYFACES-4536 at 10/3/23 5:36 AM: --- [~melloware] could you make it work, if not then I have to look into the other responsewriters, to find which one is responsible to cause such a behavior in the chain! was (Author: werpu): [~melloware] could you make it work, if not then I have to look into the other responsewriters, to find which one is at culprit here! > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, image-2023-10-02-20-33-05-162.png, > mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771458#comment-17771458 ] Werner Punz edited comment on MYFACES-4536 at 10/3/23 12:18 PM: Ok I will alter my test accordingly, lets see! Still passing: [https://gist.github.com/werpu/93e05f0cba260be33349afec8564c9d9] Is producing: {code:java} {code} So no swallowed eval! was (Author: werpu): Ok I will alter my test accordingly, lets see! > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, image-2023-10-02-20-33-05-162.png, > mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MYFACES-4536) PartialResponseWriter: Do no wrap the writer
[ https://issues.apache.org/jira/browse/MYFACES-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771458#comment-17771458 ] Werner Punz edited comment on MYFACES-4536 at 10/3/23 12:21 PM: Ok I will alter my test accordingly, lets see! Still passing: [https://gist.github.com/werpu/93e05f0cba260be33349afec8564c9d9] Is producing: {code:java} {code} So no swallowed eval! So, neither the partial response writer nor the HTMLResponseWriterImpl produce this problem (those are the ones which are in the chain) was (Author: werpu): Ok I will alter my test accordingly, lets see! Still passing: [https://gist.github.com/werpu/93e05f0cba260be33349afec8564c9d9] Is producing: {code:java} {code} So no swallowed eval! > PartialResponseWriter: Do no wrap the writer > > > Key: MYFACES-4536 > URL: https://issues.apache.org/jira/browse/MYFACES-4536 > Project: MyFaces Core > Issue Type: Improvement > Components: General >Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 4.0.0-RC2 >Reporter: Melloware >Assignee: Werner Punz >Priority: Major > Attachments: csp-results.zip, image-2023-10-02-20-33-05-162.png, > mojarra-csp-new.txt > > > Per BalusC: > Since JSF 2.3 the default constructor of {{FacesWrapper}} subclasses has been > deprecated in order to force implementors to instead use the constructor > taking the wrapped instance (and to raise their awareness), so that logically > the inherited {{getWrapped()}} method will be used throughout the > implementation instead of the local {{wrapped}} variable. This will ensure > that the correct implementation is returned and correct behavior is performed > might the {{FacesWrapper}} implementation itself being wrapped by yet another > {{FacesWrapper}} implementation further down the chain. Because, when the > {{FacesWrapper}} implementation incorrectly/accidentally uses the local > {{wrapped}} variable instead of the {{getWrapped()}} method, then that other > {{FacesWrapper}} implementation will basically be completely ignored, hereby > breaking the decorator pattern. > > PrimeFaces ticket: https://github.com/primefaces/primefaces/issues/9518 -- This message was sent by Atlassian Jira (v8.20.10#820010)