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 aJSON
response which I don't feel good doing from abean
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 theActionListener
- 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 thebean
(@Inject' service to both
beanand
REST` service)
Alternatively, is there a way to actually fetch by @ViewScoped
bean given that I have the viewstate
form field?