Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mojarra-dev] How to send blob to backing bean?

I generell i think there are 2 possible ways:
1) encode it as base64 and post it as remoteCommand param
2) fake a fileupload (in PrimeFaces we use a jquery script for uploading without full postback, i think its called iframe transport plugin)

Virenfrei. www.avast.com

Am Mi., 21. Aug. 2019 um 19:14 Uhr schrieb Guillermo González de Agüero <z06.guillermo@xxxxxxxxx>:
Hi,

I'm developing an application in which I need to edit an image and send the (_javascript_ blob) result to the backing bean. This is different from the usual JSF approach in which all that processing would be done on the server side. In my case, I'm using a 3rd party JS library that already gives me the blob, which I'd like to directly use instead of sending the coordinates for Java to reedit the image locally.

Since the blob can be large, I'd like to POST it as binary. However, I haven't found any way to do it and receive an InputStream on the backing bean. RemoteCommand only accepts string parameters, and the JSF WebSocket component is basically unidirectional, from server to client.

In future versions, the WebSocket integration could be made bidirectional, with a new annotation for incoming messages on the backing bean. Annotated methods could receive a Reader or an InputStream as parameter. Also, the RemoteCommand component could also support binary parameters. I'll open an issue for that proposals.

For now, can anybody think of a workaround for my usecase?


Regards,

Guillermo González de Agüero
_______________________________________________
mojarra-dev mailing list
mojarra-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/mojarra-dev

Back to the top