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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:29:13+00:00 2026-05-27T17:29:13+00:00

I have an InputFile isntance put on my form from Java code like this:

  • 0

I have an InputFile isntance put on my form from Java code like this:

FacesContext context = FacesContext.getCurrentInstance();

MethodExpressionActionListener meal = new MethodExpressionActionListener(context.getApplication().getExpressionFactory().createMethodExpression(context.getELContext(), "#{mybackingbean.fileUploadEvent}", null,
        new Class[] { ActionEvent.class }));

InputFile inputFile = new InputFile();
inputFile.setAutoUpload(false);
inputFile.addActionListener(meal);
//inputFile.setActionExpression(...) - did not work
//inputFile.setAction(..) - did not work

parent.getChildren().add(inputFile);

The component renders correctly, after clicking the upload button the browser sends the POST request but my backing bean is never notified. I tried the similar-looking setActionExpression and setAction methods as well to bind the component to my bean but nothing happens.

Do you have any ideas how to make my backing bean aware of the file upload outcome..?

Updated

Switching on more logging I can see that the file is uploaded and this is logged:

2011-12-07 22:12:54,097 UploadServer DEBUG - UploadServer  doLifecycle :: Window00303:j_id117 in form 'Window00303' -> FileInfo: {
  percent=100,
  preUpload=false,
  postUpload=false,
  exception=null,
  fileName=abcchmvw.INI,
  file=[...],
  physicalPath=[...],
  contentType=application/octet-stream,
  size=437,
  status=2
}

I decompiled the UploadServer but can’t see the reason why my actionListener should be called.

  • 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-27T17:29:13+00:00Added an answer on May 27, 2026 at 5:29 pm

    The solution is addActionListener but the important thing that failed all was not setting an id for the component via calling setId()

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

Sidebar

Related Questions

I have the following code: String inputFile = somefile.txt; FileInputStream in = new FileInputStream(inputFile);
Im developing a simple application that have a line like this: string[] values =
Let's say for example I have this code: <input type=file id=file name=> <input class=uploadarea>
I have read about this from several places. I have tried the method found
I have to parse an XML document that looks like this: <?xml version=1.0 encoding=UTF-8
I have an input file something like this: some line some other line another
I have a dot file generated from my code and want to render it
I have an irregular list where the data look like this: [Number] [Number] [Number]
Ok So this code I have below is compiling but I have a logic
I have JavaScript code which copies the value of input file and paste it

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.