question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic Content Streaming: Evaluate possibility to reduce method call to 1 with getExpectedType

See original GitHub issue

Currently our DynamicContentSrcBuilder receives the “value” to check the type of the “value” ValueExpression return value (String/StreamedContent). In theory we could also use ValueExpresison#getExpectedType(), so we can reduce the first call when rendering the view.

Also see https://primefaces.github.io/primefaces/10_0_0/#/core/dynamiccontent

This should work in most cases, we should check some cases with composites, f:param to a ui:include and some JSF/EL impls. We can still do a fallback if the expectedType doesnt return StreamdContent/String/byte[].

This would allow us to use a direct binding to a byte[] without having 2 calls to the “create image stream logic”, which is currently prevented by DefaultStreamedContentBuilder#stream(lamba), as the lambda is only invoked once. But we also have to add a contentType attr to the components like graphicImage/avatar.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
tandraschkocommented, Feb 1, 2021

please create a new issue if you would like to see it, thats a different topic

1reaction
tandraschkocommented, Feb 1, 2021

We could even think about a more radical change. The first call is only required because of non-dynamic images (value=/mydir/mydir.jpg). If we make p:graphicImage only support dynamic images, we can get rid of the this check as p:graphicImage doesnt have any benefits over h:graphicImage for non-dynamic images. Or create a new p:dynamicImage and deprecate p:graphicImage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphicImage: allow byte[] and InputStream as value #6967
Dynamic Content Streaming : Evaluate possibility to reduce method call to 1 with getExpectedType #6916. Closed.
Read more >
tree/tree/src/TTree.cxx Source File - ROOT
30A TTree represents a columnar dataset. Any C++ type can be stored in its columns. 31. 32A TTree, often called in ...
Read more >
tree/tree/src/TTree.cxx Source File - ROOT
1283 /// This allows another process to analyze the Tree while the Tree is being filled. 1284 ///. 1285 /// if option contains...
Read more >
9c6f3112ffe942e4bb0b5d5d847...
2ba2163: Extract method that sets content to the holder. 9c5a392: NPE (IDEA-115607). Change-Id: I83d19d7826b59dbc1d782247b78553b4632e7635
Read more >
Index (groovy 3.0.7 API)
This code is executed after the method is optionally called. afterInvoke(java.lang. ... ASTTestTransformation.1 - Class in org.codehaus.groovy.transform.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found