We try to send parameters in an ajax call (GET method) that could be retrieved in the serveRessource method of the portlet.
We use a RessourceRequest.getParameter() in the serveRessource to retrieve the params.
This seems to work correctly in the portlet container (beta4 and rc2) but not in the WebOS platform (ultimateProduct version 23239) ? is this normal ? Is there something to change to make it work ?
Ajax Code :
function asynchGetXMLHttpRequestToPortlet() { var requestURL = document.getElementById("resourceURL").value; portletReq = getHttpRequest(); if (portletReq === false) { alert("Exception: I could not find the XMLHttpRequest");
} portletReq.> portletReq.open('GET', requestURL+"&test=true&test2=false", true); portletReq.send(null); }
Java Code :
public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException {
System.out.println("Was in serveResource"); String test=request.getParameter("test"); }
Bruno
[exoplatform] Request parameter / Ajax Call,
Bruno GRILHERES