How to create renderURL
<%
PortletURL renderUrlFromJSP = renderResponse.createRenderURL();
renderUrlFromJSP.setParameter("param1", "This portletULR is created with API in JSP");
renderUrlFromJSP.setWindowState(LiferayWindowState.NORMAL);
renderUrlFromJSP.setPortletMode(LiferayPortletMode.VIEW);
%>
<a href="<%=renderUrlFromJSP%>">Render Url created by JAVA API in JSP</a>
How to create ActionURL
from renderResponse object
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@page import="javax.portlet.PortletURL"%>
<portlet:defineObjects />
<%
PortletURL actionURL = renderResponse.createActionURL();
actionURL.setParameter("javax.portlet.action", "someProcessAction");
%>
<a href="<%=actionURL%>">Call Process Action</a>
@ProcessAction
(name=
"someProcessAction"
)
public
void
someProcessAction(ActionRequest actionRequest, ActionResponse actionResponse){
String value = ParamUtil.getString(actionRequest,
"some-parameter"
);
System.out.println(
"#######Calling some process action##############"
);
}
This is the easiest way to create action URL. For example
<%@ taglib uri=
"http://java.sun.com/portlet_2_0"
prefix=
"portlet"
%>
<portlet:defineObjects />
<portlet:actionURL var=
"actionURL"
name=
"someProcessAction"
/>
<a href=
"<%=actionURL%>"
>Call Process Action</a>