Fórum

Liferay 6.2 Ajax Problem

David Gitonga, modificado 7 Anos atrás.

Liferay 6.2 Ajax Problem

Junior Member Postagens: 63 Data de Entrada: 26/07/13 Postagens Recentes
Hi Guys,
I need some help here.
I was working on liferay 6.1 and my ajax was working,
sample code:
<portlet:actionurl name="getCountry" var="getCountry" />
$.ajax({
url:'&lt;%=getCountry%&gt;',
type:'post',
success:function(response){
alert(response);
}
});


Server:
public class Country extends MVCPortlet {

public void getCountry(ActionRequest request, ActionResponse response)
			throws IOException {
           HttpServletResponse httpServletResponse = PortalUtil
				.getHttpServletResponse(response);
		 
		PrintWriter out = httpServletResponse.getWriter();

		out.print("Test Country");
		out.flush();
		out.close();
		 

}

}


Now The above code would work well with liferay 6.1 but once i upgraded to 6.2 it doesn't seem to send response.
what would be the problem.

Thank you.
thumbnail
Daniele Baggio, modificado 7 Anos atrás.

RE: Liferay 6.2 Ajax Problem

Expert Postagens: 336 Data de Entrada: 05/12/08 Postagens Recentes
We need to understand how the "getCountry" url is built.

Maybe I've understand the problem behind...
thumbnail
Sushil Patidar, modificado 7 Anos atrás.

RE: Liferay 6.2 Ajax Problem

Expert Postagens: 467 Data de Entrada: 31/10/11 Postagens Recentes
Hi,

Any error in the server logs?
I think you should use resource URL instead of action Url.

Regards