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 6659889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:05:11+00:00 2026-05-26T02:05:11+00:00

Using the code below I can’t get the image in the web page. I’m

  • 0

Using the code below I can’t get the image in the web page. I’m not sure if I understand the documentation in the right way and I’m not able to find any problem with this code.

BEAN

@ManagedBean(name = "imageBean")
@RequestScoped
public class ImageBean {
    public void paint(OutputStream os, Object data) throws IOException {
        BinaryContent content = (BinaryContent) data;
        BufferedImage image = ImageIO.read(new ByteArrayInputStream(content.getContent()));
        ImageIO.write(image, "jpg", os);
    }
}

PAGE

<rich:dataTable value="#{dataProviderBean.aoRequests}" var="item">
    <f:facet name="noData">No messages are available.</f:facet>
    ...
    <rich:column>
        <f:facet name="header">Image data</f:facet>
        <rich:list value="#{item.imageContents}" var="content">
            <a4j:mediaOutput element="img" cacheable="false" session="false"
                createContent="#{imageBean.paint}" value="#{content}" />
        </rich:list>
    </rich:column>
</rich:dataTable>
  • 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-26T02:05:12+00:00Added an answer on May 26, 2026 at 2:05 am

    If someone will have the same problem in the future, here is the solution:

    The content I put into value attribute is an object which holds binary data of a image. Because it is serialized in URL, the length is too big and it does not work. You have to pass some id and fetch the object in the paint method.

    Example

    <rich:dataTable value="#{dataProviderBean.aoRequests}" var="item">
        <f:facet name="noData">No messages are available.</f:facet>
        ...
        <rich:column>
            <f:facet name="header">Image data</f:facet>
            <rich:list value="#{item.imageContents}" var="content">
                <a4j:mediaOutput element="img" cacheable="false" session="false"
                    createContent="#{imageBean.paint}" value="#{content.id}" />
            </rich:list>
        </rich:column>
    </rich:dataTable>
    

    BEAN

    public void paint(OutputStream os, Object data) throws IOException {
        String id = (String) data;
        BinaryContent content = (BinaryContent) getContentById(id);
        os.write(content.getContent());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a mobile friendly web page using the code below. When
As of right now I'm using this code below to download files to get
In past, I am using Listview and using below code can show a particular
I'm using the code provided below to display time and date. can anyone help
i can establish a connection using HttpUrlConnection. my code below. client = new DefaultHttpClient();
VS 2008 I am using the code below to detect if the client can
I just cant get this working. I tried using the code below with onTouchEventand
Using the code below to send. The gen_tcp:send call returns {error,einval} but I can't
I'm using the code below, it seem sometime the socket is not released How
I am using the code below to get information from a database and make

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.