This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
First of all, the fact that the page was generated by a JSP is irrelevant. Once the response gets to the browser, it's just an HTML page like any other.
You'll also need to explain what you are trying to do with more clarity. It's not clear what you are trying to do. Are you asking how to execute two functions upon receiving the response of an Ajax request? Some thing else? How do the text fields that you mentioned factor into this?