[jira] [Commented] (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=17771486#comment-17771486 ] Melloware commented on MYFACES-4536: Thanks for your help! Got to the bottom of it! See my PR and I think all our integration tests are passing again! [https://github.com/primefaces/primefaces/pull/10759] Basically had to get rid of our Wrapper as it was not doing anything and extend PartialResponseWriter directly. Then I had to make our CSPPartial extend our PrimePartial so `endDocument` was called correctly. > 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] [Commented] (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=17771458#comment-17771458 ] Werner Punz commented on MYFACES-4536: -- 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] [Commented] (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=17771454#comment-17771454 ] Melloware commented on MYFACES-4536: I see the difference between your code and PrimeFaces code. Your code is directly calling {code:java} _writer.startElement("eval", null); {code} In PrimeFaces we have a PrimePartialResponseWriter that does this... {code:java} @Override public void startEval() throws IOException { startMetadataIfNecessary(); super.startEval(); } {code} Then our code when its encoding is calling the Myfaces startEval and endEval() directly its not calling start and end element. {code:java} protected void encodeScripts(PrimeRequestContext requestContext) throws IOException { List initScripts = requestContext.getInitScriptsToExecute(); List scripts = requestContext.getScriptsToExecute(); if (!initScripts.isEmpty() || !scripts.isEmpty()) { startEval(); // START EVAL inherited for (int i = 0; i < initScripts.size(); i++) { getWrapped().write(initScripts.get(i));getWrapped().write(';'); } for (int i = 0; i < scripts.size(); i++) { getWrapped().write(scripts.get(i)); getWrapped().write(';');} endEval(); // START EVAL inherited } } {code} > 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] [Commented] (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=17771441#comment-17771441 ] Melloware commented on MYFACES-4536: Let me do some more debugging and report back! > 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] [Commented] (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=17771339#comment-17771339 ] Werner Punz commented on MYFACES-4536: -- [~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] [Commented] (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=17771243#comment-17771243 ] Werner Punz commented on MYFACES-4536: -- 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] [Commented] (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=17771239#comment-17771239 ] Melloware commented on MYFACES-4536: OK I know in other places I have had to override the clone. {code:java} @Override public ResponseWriter cloneWithWriter(Writer writer) { return new CspResponseWriter(getWrapped().cloneWithWriter(writer), this.cspState); } {code} > 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] [Commented] (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=17771238#comment-17771238 ] Werner Punz commented on MYFACES-4536: -- 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] [Commented] (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=17771222#comment-17771222 ] Melloware commented on MYFACES-4536: OK I just wanted to check so I implemented the change in PrimeFaces again and our integration tests pass in Mojarra and fail in MyFaces: https://github.com/primefaces/primefaces/actions/runs/6383060016 > 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] [Commented] (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=17771191#comment-17771191 ] Melloware commented on MYFACES-4536: OK I think I might know what is going on let me try something. > 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] [Commented] (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=17771165#comment-17771165 ] Werner Punz commented on MYFACES-4536: -- 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] [Commented] (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=17771077#comment-17771077 ] Melloware commented on MYFACES-4536: [~tandraschko] I can try and take a look but I am definitely not fully comfortable in this code base and understanding how some of these tests work. > 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] [Commented] (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=17770702#comment-17770702 ] Thomas Andraschko commented on MYFACES-4536: [~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] [Commented] (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=17770700#comment-17770700 ] Thomas Andraschko commented on MYFACES-4536: JFYI the last linked link is not related to this issue, so please ignore > 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] [Commented] (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=17770196#comment-17770196 ] Werner Punz commented on MYFACES-4536: -- Thanks I will tackle this now asap, sorry for the delay, I was bound by private life and projects. I guess I will find time to start to work on it at the weekend! > 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] [Commented] (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=17770005#comment-17770005 ] Melloware commented on MYFACES-4536: [~werpu] just found another similar one reported for Myfaces 4.0.1 its stripping out custom data: https://github.com/orgs/primefaces/discussions/123#discussioncomment-7133027 > 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] [Commented] (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=17756573#comment-17756573 ] Werner Punz commented on MYFACES-4536: -- 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] [Commented] (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=17753335#comment-17753335 ] Werner Punz commented on MYFACES-4536: -- I will have a look at this bug, the next few days. Might take a few days since atm I only can work on myfaces in my sparetime, but I have it on my radar now! > 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] [Commented] (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=1775#comment-1775 ] Melloware commented on MYFACES-4536: We were basically masking this bug in PrimeFaces by having our own PartialResponseWriter that we now want to remove since we don't support older JSF anymore only 2.3 and higher which exposed this issue. > 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] [Commented] (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=17753332#comment-17753332 ] Werner Punz commented on MYFACES-4536: -- 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] [Commented] (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=17753311#comment-17753311 ] Melloware commented on MYFACES-4536: Attached is Mojarra from the PR with no wrapped writer. [^mojarra-csp-new.txt] > 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] [Commented] (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=17753309#comment-17753309 ] Melloware commented on MYFACES-4536: Let me grab Mojarra but yes the ENTIRE `eval` section is gone. Attached in the zip are 3 responses captured. [^csp-results.zip] In the zip *myfaces-csp-current.txt* - is the response from PF13 with CSP enabled *myfaces-csp-new.txt* - is the response from the PR which shows the `eval` is completely missing *myfaces-non-csp.txt* - is with CSP disabled > 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 > > > 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] [Commented] (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=17753305#comment-17753305 ] Thomas Andraschko commented on MYFACES-4536: do you mean the complete eval node is lost? can you post both mojarra and myfaces response? > 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 > > 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] [Commented] (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=17753299#comment-17753299 ] Melloware commented on MYFACES-4536: OK I ran both the old and the new code in PrimeFaces CSP mode and the only difference in the Partial Response is in the non wrapped mode MyFaces is stripping this from the end of the payload. {code:java} {code} So its not evaluating our CSP.register() scripts thus breaking our integration tests. I have a feeling it has to do with MyFaces PartialResponseWriterImpl.java which does some double buffering [~werpu] ??? It has all kinds of logic in there trying to strip CDATA out??? This stuff does not exist in Mojarra and its currently working. So to me this is a MyFaces bug buried in this PartialResponseWriterImpl logic. > 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] [Commented] (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=17752098#comment-17752098 ] Thomas Andraschko commented on MYFACES-4536: how is this exactly related to MF, compared to Mojarra? > 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] [Commented] (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=17752096#comment-17752096 ] Melloware commented on MYFACES-4536: [~tandraschko] it looks like this one is still using the wrapped in PF. I think this is still the problem: [https://github.com/primefaces/primefaces/blob/master/primefaces/src/main/java/org/primefaces/context/PartialResponseWriterWrapper.java] ??? > 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] [Commented] (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=17752075#comment-17752075 ] Thomas Andraschko commented on MYFACES-4536: [~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] [Commented] (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=17684156#comment-17684156 ] Melloware commented on MYFACES-4536: I stopped investigating for now once I realized if I fixed the PrimeFaces code it will break 2.2 compatibility. I can try it again this week by making the changes and running the tests to see why MyFaces doesn't like the change. It was failing our integration tests. > 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] [Commented] (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=17684126#comment-17684126 ] Thomas Andraschko commented on MYFACES-4536: [~melloware] what about this one? > 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] [Commented] (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=17649473#comment-17649473 ] Melloware commented on MYFACES-4536: In PrimeFaces the current PartialResponseWriter wraps and delegates with a local variable. {code:java} public class PartialResponseWriterWrapper extends PartialResponseWriter { private PartialResponseWriter wrapped; public PartialResponseWriterWrapper(PartialResponseWriter wrapped) { super(wrapped); this.wrapped = wrapped; } @Override public void delete(String targetId) throws IOException { wrapped.delete(targetId); } @Override public void endDocument() throws IOException { wrapped.endDocument(); } @Override public void endError() throws IOException { wrapped.endError(); } @Override public void endEval() throws IOException { wrapped.endEval(); } @Override public void endExtension() throws IOException { wrapped.endExtension(); } @Override public void endInsert() throws IOException { wrapped.endInsert(); } @Override public void endUpdate() throws IOException { wrapped.endUpdate(); } @Override public void redirect(String url) throws IOException { wrapped.redirect(url); } @Override public void startDocument() throws IOException { wrapped.startDocument(); } @Override public void startError(String errorName) throws IOException { wrapped.startError(errorName); } @Override public void startEval() throws IOException { wrapped.startEval(); } @Override public void startExtension(Map attributes) throws IOException { wrapped.startExtension(attributes); } @Override public void startInsertAfter(String targetId) throws IOException { wrapped.startInsertAfter(targetId); } @Override public void startInsertBefore(String targetId) throws IOException { wrapped.startInsertBefore(targetId); } @Override public void startUpdate(String targetId) throws IOException { wrapped.startUpdate(targetId); } @Override public void updateAttributes(String targetId, Map attributes) throws IOException { wrapped.updateAttributes(targetId, attributes); } } {code} However if the code is changed to use the non wrapped class and delegate to MyFaces directly the Integration Tests fail but Mojarra still passes. {code:java} public class PartialResponseWriterWrapper extends PartialResponseWriter { public PartialResponseWriterWrapper(PartialResponseWriter wrapped) { super(wrapped); }} {code} > 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 >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)