JavaServer Faces not calling setter method

Discussion in 'Java' started by Martin Kess, Dec 20, 2005.

  1. Martin Kess

    Martin Kess Guest

    I'm using JSF's myfaces implementation, and I've run into a problem
    that I can't figure out how to fix.

    My getter and setter are as follows:

    public UploadedFile getUpFile() {
    return this.upFile;
    }
    public void setUpFile(UploadedFile upFile) {
    this.upFile = upFile;
    }

    The relevant line in my JSP file:
    <x:inputFileUpload size="100" id="upFileId"
    value="#{CsvUploadBean.upFile}" storage="file" required="true"/>

    And the managed bean is defined as follows:

    <managed-bean>
    <managed-bean-name>CsvUploadBean</managed-bean-name>
    <managed-bean-class>bean.CsvUploadBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>defeinedFileSize</property-name>
    <value>5m</value>
    </managed-property>
    </managed-bean>

    Now my problem is that my getter method (getUpFile) gets called when
    it's supposed to, but my setter (setUpFile) never gets called.

    Anyone have any idea why that could be?

    Thanks in advance.
     
    Martin Kess, Dec 20, 2005
    #1
    1. Advertising

  2. Martin Kess

    Danno Guest

    what does your jsp page look like?
     
    Danno, Dec 20, 2005
    #2
    1. Advertising

  3. Martin Kess

    hiwa Guest

    >From the tomahawk javadoc for inputFileUpload tag:
    <quote>
    value false false java.lang.String Initial value to set when rendered
    for the first time.
    </quote>
    Apparently, only getter is supported ...
     
    hiwa, Dec 20, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. one

    JavaServer Faces

    one, Dec 7, 2003, in forum: Java
    Replies:
    2
    Views:
    497
    Ajay Patil
    Dec 8, 2003
  2. ranma79

    JavaServer Faces (JSF) Question

    ranma79, Apr 5, 2004, in forum: Java
    Replies:
    1
    Views:
    420
    Chris Smith
    Apr 7, 2004
  3. Ittay Dror
    Replies:
    0
    Views:
    365
    Ittay Dror
    Apr 19, 2004
  4. Roger
    Replies:
    0
    Views:
    465
    Roger
    Sep 1, 2004
  5. Replies:
    0
    Views:
    537
Loading...

Share This Page