How can we embed and show an InputStream as dynamic image in JSF 2.0 with OmniFaces?
Show an InputStream as dynamic image in JSF
2.6k Views Asked by ngadde At
1
There are 1 best solutions below
Related Questions in JSF-2
- Strange java.lang.ArrayIndexOutOfBoundsException rendering error in jsf application under high load
- Ajax-update only a component attribute, not the whole component nor its children
- How to instantiate a backing bean on page load
- How to add '%' symbol in textbox using jsf and jsp?
- Primefaces datatable duplicate "No records found" while doing column freeze for empty records
- How to provide a file download from a JSF backing bean using af:commandMenuItem?
- Using multiple FluidGrids in one form
- Masks in JSF2 with rich:jQuery?
- IceFaces message not showing
- Add table plugin to primefaces editor
- this.jq.draggable is not a function when using primefaces dialog framework
- Setting f:setPropertyActionListener value with a f:param value
- It is possible to download file on p:poll
- Spring Boot with Jsf views
- JSF, Target unreachable
Related Questions in INPUTSTREAM
- Java Socket - how does the read() method know if the end of stream has been reached?
- What is meant by Streams w.r.t Java IO
- Read file from local PC from network deployed app to InputStream
- PDFBox: extracting images from pdf to inputstream
- InputStream vs Reader
- Reading content from a URL failing
- InputStream appears to be loading twice
- skip method in CipherInputStream
- How to send ZipInputStream as attachment via java mail?
- Reading Microsoft Word in order read
- Parse InputStream "on the fly" / re-use an InputStream
- audio reading in jar executable file
- How to download and stream audio in Android?
- Trying to use getResourceAsStream() and failing
- Cannot get an image from inputStream
Related Questions in OMNIFACES
- Facelets error page works during ajax request with FullAjaxExceptionHandler, but does not evaluate EL during synchronous request
- java.util.ServiceConfigurationError when running tests using arquillian+omnifaces
- JSF ViewState lost in ajax call after form validation fails and form contains Primefaces outputPanel with deferred="true" attribute
- CombinedResourceHandler excluded resources doesn't recognize resources with query string
- OmniFaces CDNResourceHandler could not find resources when not included locally
- OmniFaces CacheControlFilter has no effect when response contains Content-Disposition header
- TomEE 7 + Omnifaces 2.5.1 CDI Beans module deployment failed
- How to integrate OmniFaces with Spring Boot
- JSF 2.2 ui:repeat setting input text component submitted value to null for immediate scenario during processDecodes
- OmniFaces ClassNotFoundException CombinedResourceHandler
- ui:repeat in o:treeNodeItem
- Cross-field validation with Omnifaces: "Enter X and Y or enter Z"
- render="@form" with Omnifaces 2.0 and Richfaces 4.5 not working
- Auto Code Completion on Eclipse Kepler for Omnifaces o:importConstants
- How to control http headers in JSF?
Related Questions in GRAPHICIMAGE
- <p:graphicImage> throws javax.el.PropertyNotFoundException on #{bean.foo().bar()}, but #{bean.fooAndBar()} works
- not load image to graphicImages
- Can't show image in p:graphicImage
- Ajax-update p:graphicImage
- <p:graphicImage> not working in jsf
- Changing language with h:graphicImage click event
- How to trigger an ajax event listener on click of p:graphicImage?
- Get concrete URL of <p:graphicImage> returning StreamedContent
- JSF won't load everything at the same time
- Show an InputStream as dynamic image in JSF
- Using fileDownload with an image
- imageRotateAndResize with Galleria in Primefaces
- p:graphicImage disappears after a while in google chrome
- Display a BLOB image using p:graphicImage in a tagfile
- how can i use graphicImage with ViewScoped Bean?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
OmniFaces does not offer any utility for this — yet.
If the image files are located on the disk file system, then you need to create a virtual context in the servletcontainer configuration so that they can be accessed by a normal URL. See also Load images from outside of webapps / webcontext / deploy folder using <h:graphicImage> or <img> tag.
If the image files are stored in the DB, then you need to create a simple servlet which just writes the
InputStreamof the image from the DB to theOutputStreamof the HTTP response. See also How to retrieve and display images from a database in a JSP page? (note that this doesn't require JSP/HTML, you can as good just use<h:graphicImage>as it merely generates a HTML<img>element).There's the PrimeFaces
<p:graphicImage>, but this is a bit unintuitive to implement. See also Display dynamic image from database with p:graphicImage and StreamedContent.Update: since OmniFaces 2.0 (for JSF 2.2) there's a
<o:graphicImage>component which supports among others directly referencing abyte[]orInputStreamproperty in an@ApplicationScopedmanaged bean in an intuitive way like below:In contrary to PrimeFaces
<p:graphicImage>, no<f:param>is needed and the EL method arguments are evaluated during render response phase, but the EL method itself is only invoked when the browser actually requests the image. See also the showcase and the blog on the subject.