Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Vivek N Kapse
Cannot use <portlet:actionURL> in struts portlet.
February 2, 2009 2:48 PM
Answer

Vivek N Kapse

Rank: Junior Member

Posts: 42

Join Date: September 9, 2008

Recent Posts

Hi, I tried to use <portlet:actionURL> tag to invoke a form action but I keep getting error (check below for the error).

Here is what i did in the .jsp file with the form :

<portlet:actionURL var="invokeAction" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="struts_action" value="/myportlet/myapp/actionClass"/>
</portlet:actionURL>

<html:form action="${invokeAction}" method="post" enctype="application/x-www-form-urlencoded" >

I also tried

<html:form action="<%=invokeAction%>" method="post" enctype="application/x-www-form-urlencoded" >

Could you please help how to use <portlet:actionURL> tag to invoke an action class?????

I am using Liferay5.1.1 with tomcat5.5 and I am trying this in struts portlet (struts1.2).

When i tried to use
<html:form action="/myportlet/myapp/actionClass" method="post" enctype="application/x-www-form-urlencoded" > I cud successfully invoke the action class but with this I WOULDN'T have the windowstate as EXCLUSIVE which is what i want (ie the result window should not use the portal theme).

I see that in the URL "p_p_state=normal" when it edit it to "p_p_state=exclusive" i get the desired result. But how to make sure i have the URL with p_p_state as exclusive???


org.apache.jasper.JasperException
Stacktrace
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
com.liferay.portal.apache.bridges.struts.LiferayRequestDispatcher.invoke(LiferayRequestDispatcher.java:158)
com.liferay.portal.apache.bridges.struts.LiferayRequestDispatcher.include(LiferayRequestDispatcher.java:82)
org.apache.portals.bridges.struts.PortletServletRequestDispatcher.invoke(PortletServletRequestDispatcher.java:128)
org.apache.portals.bridges.struts.PortletServletRequestDispatcher.include(PortletServletRequestDispatcher.java:146)
KK rajput
RE: Cannot use <portlet:actionURL> in struts portlet.
February 2, 2009 10:33 PM
Answer

KK rajput

Rank: Expert

Posts: 266

Join Date: April 10, 2008

Recent Posts

You can try like this as well :

<% PortletURL url = renderResponse.createActionURL();
url.setWindowState(WindowState.NORMAL);
url.setParameter("struts_action", "struts_action_path");
%>