@Marin I thought synchronous Ajax is actively discouraged now? Or is it supported through webworkers now? (see: https://xhr.spec.whatwg.org/#the-open()-method )
I would just generate a random secret the moment the form is rendered. Then, in javascript, you can use your favorite symmetric block cipher to replace the values/encode them in json (for example in a hidden field. Server side you do the reverse -Rob On Mon, Jan 16, 2017 at 8:36 AM, James Selvakumar <[email protected]> wrote: > Hi Martin, > > Thanks a lot for your response. > Can I add this behavior directly to the form or should this be added to a > form component? > Will this work on Wicket 6.x? > > On Mon, Jan 16, 2017 at 3:29 PM, Martin Grigorov <[email protected]> > wrote: > > > Hi, > > > > The easiest way I see is to use onBeforeSend() callback listener on the > > Ajax submit behavior of the form. > > There you can do a **synchronous** Ajax call to get your key and then > > modify (i.e. encrypt) the data to be sent. > > > > Martin Grigorov > > Wicket Training and Consulting > > https://twitter.com/mtgrigorov > > > > On Mon, Jan 16, 2017 at 8:08 AM, James Selvakumar <[email protected]> > > wrote: > > > > > Hi all, > > > > > > I have this requirement where some of the data entered by the user are > to > > > be encrypted in the client side before the request is submitted to the > > > Wicket server even though the communication is over HTTPS. > > > > > > I am thinking of having some JavaScript code in the client which shall > > > intercept the form submission, request the Server for a randomly > > generated > > > key and encrypt the form data using the key received and then submit > the > > > form again. > > > > > > Any idea how to achieve this in Wicket? > > > > > > -- > > > Thanks & regards > > > James > > > > > > > > > -- > Thanks & regards > James Selvakumar >
