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
POSTand expects aJSONresponse which I don't feel good doing from abeanmethod. - Fileupload plugin does multiple concurrent file
POSTs, 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
hiddenfield with the location of the files and process them in theActionListener - Same as above, but also call the
ActionListenerfrom JQuery - Store data in the session (since I can access it, from my REST service)
- Use an
@EJBqueue service to pass the data to thebean(@Inject' service to bothbeanandREST` service)
Alternatively, is there a way to actually fetch by @ViewScoped bean given that I have the viewstate form field?