1

I have created a REST service for uploading files. Because of various requirements, I cannot integrate that into the JSF lifecycle. Amongst others:

  • JQuery handles the POST and expects a JSON response which I don't feel good doing from a bean method.
  • Fileupload plugin does multiple concurrent file POST s, which AFAIK is not possible (by default) JSF behaviour as event's will be queued.

I have a few options in mind, but I would like to be as intrusive as possible. The ones I have examined so far are:

  • Using JQuery, populate a hidden field with the location of the files and process them in the ActionListener
  • Same as above, but also call the ActionListener from JQuery
  • Store data in the session (since I can access it, from my REST service)
  • Use an @EJB queue service to pass the data to the bean (@Inject' service to bothbeanandREST` service)

Alternatively, is there a way to actually fetch by @ViewScoped bean given that I have the viewstate form field?

Ioannis Deligiannis
  • 2,679
  • 5
  • 25
  • 48

0 Answers0