Foren
jQuery.ajax URL
andy worthington, geändert vor 14 Jahren.
jQuery.ajax URL
New Member Beiträge: 9 Beitrittsdatum: 07.07.09 Neueste Beiträge
Hi,
I am using Liferay 5.2 and developing portlets in Netbeans, I wish to use AJAX to make calls to a .jsp file and return data.
I am unsure how to create a valid url to do this, the examples I have seen so far look something like this :
I don't know how to use the struts action param or whether this is actually necessary.
I feel slightly embarassed at having to ask but can someone explain how i can make a call to a jsp file without using an absolute URL or is that the only way to do it ?
Thanks in advance.
I am using Liferay 5.2 and developing portlets in Netbeans, I wish to use AJAX to make calls to a .jsp file and return data.
I am unsure how to create a valid url to do this, the examples I have seen so far look something like this :
<portlet:actionurl windowstate="<%= LiferayWindowState.EXCLUSIVE.toString() %>"><portlet:param name="struts_action" value="/login/getNamess" /></portlet:actionurl>
I don't know how to use the struts action param or whether this is actually necessary.
I feel slightly embarassed at having to ask but can someone explain how i can make a call to a jsp file without using an absolute URL or is that the only way to do it ?
Thanks in advance.
andy worthington, geändert vor 14 Jahren.
RE: jQuery.ajax URL
New Member Beiträge: 9 Beitrittsdatum: 07.07.09 Neueste Beiträge
In case anyone else is having simlar thoughts we solved this by using a RESTful web service and a proxy jsp file placed in webapps/ROOT that makes an ajax call via jQuery to the web service.
Sampsa Sohlman, geändert vor 14 Jahren.
RE: jQuery.ajax URL
Regular Member Beiträge: 230 Beitrittsdatum: 27.09.07 Neueste Beiträge
You can call JSP file through servlet, so you can choose the url on web.xml. If the servlet is calling your JSP file inside under <web-app-root/WEB-INF/ directory then the jsp it self it is not visible to rest of the world.
For Ajax I would suggest to see DWR which I have had very good experienes also with Liferay.
For Ajax I would suggest to see DWR which I have had very good experienes also with Liferay.