Updating the contents of the messageText element would require adding the following into the JavaScript where you currently have "now what?":
document.getElementById("<portlet:namespace />messageText").innerHTML = xhr.responseText;
However, the larger problem is that you're attempting to use Ajax in a portlet with a version of Spring that only supports JSR 168 (Portlet Spec 1.0). Resource Requests, which are how Ajax calls are typically handled, were not introduced until JSR 286 (Portlet Spec 2.0).
Updating the JavaScript with my suggested code results in the entire portal page being added as the innerHTML of the messageText element, as the ActionRequest resulted in a full RenderRequest being triggered for the portlet.