I have bulid a portlet in Liferay Portal and have used Ajax. When I open the site without www everything is correct, but when I use www the Ajax request URL is without www and then the response is empty. My Liferay Portal version开发者_运维百科 is 5.1.1 and I use plugins-sdk and use the Struts 2 portlet and JSR 168.
I have noticed that if I want to request a portlet with windowState that is not normal? I should request the portlet before with normal state and if a request is with www
or without www
the second request have be the same with the normal request (normal windowState).
jQuery.ajax({
url : '<portlet:actionURL windowState="exclusive" >
<portlet:param name="struts.portlet.action" value="/view/view/search"/> </portlet:actionURL >' ,
data : <portlet:namespace/>form_data ,
success : function (result){
jQuery("#<portlet:namespace/>search_results").html(result);
}
});
actionURL is not added www to URL.
How can this problem be fixed?
jQuery.ajax({
url : '<portlet:renderURL windowState="exclusive" >
<portlet:param name="struts_action" value="/view/view/search"/> </portlet:renderURL >' ,
data : <portlet:namespace/>form_data ,
success : function (result){
jQuery("#<portlet:namespace/>search_results").html(result);
}
});
精彩评论