• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

primeface download not working

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I tried to implement download but it does not work. I try to call "getFile" function but nothing happens.
Under form :


In my remote controller :


My log :



Thanks for your responses
 
Saloon Keeper
Posts: 28660
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, first, I'm going to be pedantic.

Althouh apparently some IDEs will define JSF backing beans with names like "xxxController", JSF backing beans are not Controllers. They are Models.

You almost never create your own Controllers in JSF as they are pre-defined as part of JSF itself.

Now for your real problem. JSF uses JEE Expression Language to access (read OR write) properties of the backing beans. In many cases the same property may be read to display a control's value then written when the control's updated value is saved. That's the diffference between the "#" expression introducer commonly used by JSF and the "$" expression introducer used on JSPs. The "$" can only read, not write.

More importantly, that means that you access the property by the property name and not by the accessor method name, since either the "get" or "set" method could be required.

In short:

(Again, MainController isn't actually a Controller). When you coded #{mainController.getFile}, what JSF actually tried to invoke was the mainController bean's "getGetFile()" method, which, of course isn't what you wanted. JSF does not display errors if you get your names wrong, unfortunately, it just silently ignores the problem. There's a reason for that, I think. but I've never seen it formally stated.
reply
    Bookmark Topic Watch Topic
  • New Topic