Struts 2: how to set response for ajax function call?
Ramesh Babu Essampalli
Joined: Oct 19, 2009
i am calling an ajax function from jsp page. The execute method of action class is getting called.
now, i want to set response parameter in execute methood for xmlhttp.responseText in ajax function call. i implemented ServletResponseAware and in setServletResponse method i set response parameter. but the response param value is over-written by return page of execute method. please suggest me a way to set response param.
You must be talking about this piece of code. When your action sends the request to a JSP page, this content will be ignored. If you don't want to send the request to the JSP, then return null from the execute method. You can't send response from action and JSP both...