Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

JavaServer Faces not calling setter method

Thread view: 
Martin Kess - 20 Dec 2005 02:31 GMT
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.
Danno - 20 Dec 2005 05:05 GMT
what does your jsp page look like?
hiwa - 20 Dec 2005 06:06 GMT
>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 ...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.