Access javascript data from Java

Hi thanks. Let me explain a little better. Basically the way I have to do it to start with, is to use JS components as opposed to java components (eventually I will refactor it and replace js with java, but for now not an option), so for now the form, popup etc is in javascript.
My task is to be able to access the data sent via ajax from java because I need to run some validation. The way I was looking at was by using a connector to make sure that the said data (in my case it’s the string that is passed through ajax to the server, postData) can be accessed by the java part of my application, so yes this https://vaadin.com/docs/-/part/framework/gwt/gwt-javascript.html would be the way I thought I could go about it.
What I meant when I said “that’s this https://vaadin.com/docs/-/part/framework/gwt/gwt-overview.html wasn’t possible” was that, since in that link it says that I would have to have a different project structure from the one I have now, I thought, well that’s not it. But I was told that even with an ordinary maven project - which is what I have - it’s possible.
So, the first thing i’ve done was to remove all the above js that used to sit inside the .java file and moved it to an external js file, script.js, so that things are a little tidier. Now I will add a connector (to start with I will add it to script.js as I’ve never done it before so I just want to make sure it works) and in this connector I will pretty much do what the link says and we take it from there. I will post back when I have some more code.
thanks