Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:51:58+00:00 2026-05-22T14:51:58+00:00

I have a web app (JSF 2.0) that should display some images. I read

  • 0

I have a web app (JSF 2.0) that should display some images.

I read in this thread and implemented an image servlet to send images to the client.
Problem is, I am not using a database nor fixed location on the hard drive, just a backing java method returning a byte[] (For the discussion, let’s say it’s generated on the fly)

I am wondering if there is a ‘standard’ solution for this problem, namely, How do you display an image that is generated on the fly on a webpage?

UPDATE
I eventually decided to use RichFaces MediaOutput Component.
The answer that is marked as correct is, in my opinion, more robust and better for most cases.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:51:59+00:00Added an answer on May 22, 2026 at 2:51 pm

    Move the byte[] code generating logic from the backing bean to the image servlet. All basic parameters which the backing bean uses to generate the byte[] should be passed as request parameters to the image servlet. E.g.

    <img src="imageservlet?param1=#{bean.param1}&param2=#{bean.param2}" />
    

    If that is really not an option for some reason, best what you could do is to let the backing bean store those images temporarily on temp disk or session and then pass its identifier as request parameter so that the servlet can locate it and write it to the response body.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app that only registered users can use, therefore I should
I have a J2EE/JSF-based web-app. It consists of an form-input, a text display and
I have a simple JSF web app as follows. The Java class contains: private
need ask you about some help. I have web app running in Net 2.0.
I have a web app for commercial property management that needs spreadsheet-like functionality for
I have a web app that is heavily loaded in javascript and css. First
I have a web app in production that is used for typical data entry,retrieval,
We're developing a Java web app that utilizes JSF (Richfaces through Seam) for its
I have a Facelets(JSF 1.2 (myfaces)) web app and I want to customize my
I have a resources web app, which only has static content, such as images,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.