Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Kiran Jai
How to set the Action defined in struts.xml to PortletURL
April 17, 2012 6:35 AM
Answer

Kiran Jai

Rank: Junior Member

Posts: 38

Join Date: April 9, 2012

Recent Posts

Inside the JSP Page i have this for making a AJAX Request within Liferay

PortletURL portleturl = response.createRenderURL();
portleturl.setWindowState(LiferayWindowState.EXCLUSIVE);

I will pass this portleturl as a url to the below JQuery function


jQuery.ajax({
type: "POST",
url: portleturl ,
success: function(msg){
alert( "Data Saved: " + msg );
}});

This is my action mapping inside the struts.xml file


<action name="helloForm" class="com.action.Struts2Action">
<result name="input">/WEB-INF/view/index.jsp</result>
<result name="success">/WEB-INF/view/result.jsp</result>
</action>

Now please tell me how do i set the action named helloForm to the portleturl ??