I had a little bit of experience in JavaScript + AJAX in PHP, but I’ve never had it before in Struts2. I had the habit in PHP which contains a div that I need to be dynamic, and so in the form there is for example a select to call a JavaScript function, that JavaScript function can be defined in the header or in a .js file, and so those JavaScript files which create ajax object and send parameters to another PHP page which contains the same name of the div to change in the first page. But, how can I project this on Struts2? Where to call the JavaScript function and the action function? Would struts2-jquery-plugin make it easier? Unfortunately I don’t any example in the both cases (native Ajax, either jQuery plugin).
Share
When writing “raw” JavaScript/jQuery the framework doesn’t really matter. You can write JS/JQ as you would with any other server framework–the client-side code is essentially identical.
The jQuery plugin does make simple use cases much simpler. For complex use cases, it’s a bit more of a tossup. It provides a pub/sub mechanism, however, which is pretty flexible.