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

  • Home
  • SEARCH
  • 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 7819479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:58:06+00:00 2026-06-02T06:58:06+00:00

I am trying to display elements of arrayList on xhtml page, but every time

  • 0

I am trying to display elements of arrayList on xhtml page, but every time i upload new file then on status page i get multiple entries of last uploaded file rather then having details about all elements present in the array.

Here is the code

XHTML Code:

<ace:dataTable id ="archiveResults" resizableColumns="true" paginatorPosition="bottom" paginator="true" page="1" value="${fileUpload.resultBeanList}" var="result">
        <ace:column id="fileUploadFileName" headerText="uploaded file" sortBy="#{result.fileName}" filterBy="#{result.fileName}" filterMatchMode="contains">
            <h:outputFormat id="cellFileUploadFileName" value="${result.fileName}" />
        </ace:column>
        <ace:column id="fileUploadTime" headerText="time run" sortBy="#{result.timeRun}" filterBy="#{result.timeRun}" filterMatchMode="contains">
            <h:outputFormat id="cellFileUploadTime" value="${result.timeRun}" />
        </ace:column>
        <ace:column id="fileUploadJobType" headerText="job type" sortBy="#{result.jobType}" filterBy="#{result.jobType}" filterMatchMode="contains">
            <h:outputFormat id="cellFileUploadJobType" value="${result.jobType}" />
        </ace:column>
        <ace:column id="fileUploadStatus" headerText="Status" sortBy="#{result.status}" filterBy="#{result.status}" filterMatchMode="contains">
            <h:outputFormat id="cellFileUploadStatus" value="${result.status}" />
        </ace:column>
</ace:dataTable>

Java Code:

  private List<ResultBean> resultBeanList = new ArrayList<ResultBean>();
    private ResultBean resultBean = new ResultBean();

    public ResultBean getResultBean() {
        return resultBean;
    }

    public void setResultBean(ResultBean resultBean) {
        this.resultBean = resultBean;
    }

    public List<ResultBean> getResultBeanList() {
        System.out.println("resultBeanList: "+resultBeanList.toString());
        return resultBeanList;
    }

    public void setResultBeanList(List<ResultBean> resultBeanList) {
        this.resultBeanList = resultBeanList;
    }

public void uploadFile(FileEntryEvent event) {
        FileEntry fileEntry = (FileEntry) event.getSource();
        FileEntryResults results = fileEntry.getResults();
        FileEntry fe = (FileEntry) event.getComponent();
        FacesContext ctx = FacesContext.getCurrentInstance();
        FacesMessage msg = new FacesMessage();
        for (FileEntryResults.FileInfo fileInfo : results.getFiles()) {
            if (fileInfo.isSaved()) {
                File file = fileInfo.getFile();
                String filePath = file.getAbsolutePath();
                resultBean.setStatus(fileInfo.getStatus().toString());
                resultBean.setFileName(fileInfo.getFileName());
                resultBean.setJobType(selectedItem);
                DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
                Date date = new Date();
                Calendar cal = Calendar.getInstance();
                dateFormat.format(cal.getTime());
                resultBean.setTimeRun(dateFormat.format(cal.getTime()));
            }
            resultBeanList.add(resultBean);
        }
    }
  • 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-06-02T06:58:08+00:00Added an answer on June 2, 2026 at 6:58 am

    I think your problem is that you are reusing your resultbean. You should create a new instance of ResultBean in your upload method, this should fix the problem.

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

Sidebar

Related Questions

I'm trying to display two <div> elements on the same line, but in the
I'm trying to display some elements from my XML file to my form which
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
Im trying to display some files in a web page so the user can
Ive been trying to display formatted content blocks from a xml file with no
I am trying to display the contents of a .cpp file in php. I
I'm trying box up a list of elements and display a some text below
I am trying to create a simple menu using li elements, but it only
I'm trying to display a specific block of html with some form elements based
I'm trying to create two side-by-side div elements, but I found that having an

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.