struts.xml
<package name="namexxx" extends="struts-portlet-default" namespace="/">
<action name="fetchServerData" class="accessServerProxyAction" method="fetchServerData">
<result name="success">/common/blank.jsp</result>
<result name="error">/common/error.jsp</result>
</action>
JSP output action URL(JSP page content)
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<portlet:renderURL var="fetchServerData" windowState="<%= com.liferay.portal.kernel.portlet.LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="struts.portlet.action" value="/fetchServerData" />
</portlet:renderURL>
<script type="text/javascript">
var accessServerProxyUrl="<%=fetchServerData%>";
</script>
AJAX use JSP output action URL to call remote server
store = new Ext.data.Store({
pageSize: 10,
model: 'xxx',
proxy: {
type: 'ajax',
url : accessServerProxyUrl,
reader: {
type: 'json',
totalProperty : 'totalProperty',
root: 'xxx',
remoteSort:true
}
}
});