I have long thought of how to make these 2 interact with each other (besides using forms, which is strictly one-way, not good).
Today, I think I have resolved it, and actually its simple, using jsp (maybe jstl), but I have yet to test this - if only I have the time - and make sure it works
java2js = JSP
js2java = xmlhttprequest
To be continued...