I send function from getMinimizedFunction.jsp using $.post to some struts2 action, which call some java method that clculates the minimized function. How can I return the minimized function from the action to the callback function in the same jsp getMinimizedFunction.jsp?
I have in my getMinimizedFunction.jsp the following code:
String function="A*B'+A*B";
url='getMinFunction.action';
pars={function:function};
$.post(url,pars,someCallback);
function someCallback(data){
do something with data; //data =A (the minimized Function)
}
You can return stream result as explained in this tutorial
Or, you can use struts2-jquery-plugin , it makes working with ajax simpler.