Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Link from a jsp in core Liferay Portlet to a jsp in own Portlet [resolved]
Hi,
I am using Liferay 6.05 with Tomcat 6.0.26.
Basically, what I want to do is create a link in a jsp in control panel to a jsp in my own portlet.
In detail, how I tried to do it was by:
Adding a link to the users view in the control panel in the Liferay Portal (enterprise_admin/user_action.jsp) and the target is supposed to be a page on my own portlet (with id 145).
I added the link by customizing user_action.jsp (in /portlet/enterprise_admin folder of liferay) by using a hook.
I created the link by adding the following lines to the user_action.jsp:
<portlet:actionURL var="sendMailURL">
<portlet:param name="struts_action" value="/messaging/send/back" />
<portlet:param name="redirect" value="<%= redirect %>" />
<portlet:param name="p_p_id" value="145"/>
<portlet:param name="p_p_state" value="maximized"></portlet:param>
<portlet:param name="p_p_mode" value="view"/>
<portlet:param name="p_u_i_d" value="<%= String.valueOf(userId) %>" />
<portlet:param name="receiverslistTypeId" value="1"/>
</portlet:actionURL>
and also added the path to struts-config.xml and tiles-defs.xml of portal (again by using the hook)
However, when I click on my link, I get the following ERROR:
ERROR [PortletRequestProcessor:367] Invalid path was requested /enterprise_admin_users/back
The problem as far as I understood is, that p_p_id=125 is given automatically in the url I've created in the very beginning and my given p_p_id is ignored. Here is the link portal creates from my sendMailURL action link:
http://localhost:8080/group/control_panel/manage?p_auth=8dsfuzHO&p_p_id=125&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&doAsGroupId=10156&refererPlid=10435&_125_struts_action=%2Fenterprise_admin_users%2Fback&_125_redirect=http%3A%2F%2Flocalhost%3A8080%2Fgroup%2Fcontrol_panel%2Fmanage%3Fp_p_id%3D125%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26doAsGroupId%3D10156%26refererPlid%3D10435%26_125_struts_action%3D%252Fenterprise_admin_users%252Fview%26_125_tabs1%3Dusers%26_125_tabs2%3D%26_125_tabs3%3D%26_125_cur%3D1%26_125_delta%3D20%26_125_keywords%3D%26_125_advancedSearch%3Dfalse%26_125_andOperator%3Dtrue%26_125_emailAddress%3D%26_125_firstName%3D%26_125_lastName%3D%26_125_middleName%3D%26_125_organizationId%3D0%26_125_roleId%3D0%26_125_screenName%3D%26_125_userGroupId%3D0%26_125_orderByCol%3Dlast-name%26_125_orderByType%3Dasc&p_p_id=145&p_p_state=maximized&p_p_mode=view&_125_p_u_i_d=10168&_125_receiverslistTypeId=1
I've tried it also with liferay-portlet tag instead of portlet tag:
<liferay-portlet:actionURL var="sendMailURL">
<portlet:param name="struts_action" value="/messaging/send/back" />
<portlet:param name="redirect" value="<%= redirect %>" />
<portlet:param name="p_p_id" value="145"/>
<portlet:param name="p_p_state" value="maximized"></portlet:param>
<portlet:param name="p_p_mode" value="view"/>
<portlet:param name="p_u_i_d" value="<%= String.valueOf(userId) %>" />
<portlet:param name="receiverslistTypeId" value="1"/>
</liferay-portlet:actionURL>
But it's the same link and error.
Do I have to change to the tag, so that I can link from that portlet to my own Portlet (Messaging)?
Any ideas how to solve that problem, or what the problem could be?
Thanks for any help.
I am using Liferay 6.05 with Tomcat 6.0.26.
Basically, what I want to do is create a link in a jsp in control panel to a jsp in my own portlet.
In detail, how I tried to do it was by:
Adding a link to the users view in the control panel in the Liferay Portal (enterprise_admin/user_action.jsp) and the target is supposed to be a page on my own portlet (with id 145).
I added the link by customizing user_action.jsp (in /portlet/enterprise_admin folder of liferay) by using a hook.
I created the link by adding the following lines to the user_action.jsp:
<portlet:actionURL var="sendMailURL">
<portlet:param name="struts_action" value="/messaging/send/back" />
<portlet:param name="redirect" value="<%= redirect %>" />
<portlet:param name="p_p_id" value="145"/>
<portlet:param name="p_p_state" value="maximized"></portlet:param>
<portlet:param name="p_p_mode" value="view"/>
<portlet:param name="p_u_i_d" value="<%= String.valueOf(userId) %>" />
<portlet:param name="receiverslistTypeId" value="1"/>
</portlet:actionURL>
and also added the path to struts-config.xml and tiles-defs.xml of portal (again by using the hook)
However, when I click on my link, I get the following ERROR:
ERROR [PortletRequestProcessor:367] Invalid path was requested /enterprise_admin_users/back
The problem as far as I understood is, that p_p_id=125 is given automatically in the url I've created in the very beginning and my given p_p_id is ignored. Here is the link portal creates from my sendMailURL action link:
http://localhost:8080/group/control_panel/manage?p_auth=8dsfuzHO&p_p_id=125&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&doAsGroupId=10156&refererPlid=10435&_125_struts_action=%2Fenterprise_admin_users%2Fback&_125_redirect=http%3A%2F%2Flocalhost%3A8080%2Fgroup%2Fcontrol_panel%2Fmanage%3Fp_p_id%3D125%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26doAsGroupId%3D10156%26refererPlid%3D10435%26_125_struts_action%3D%252Fenterprise_admin_users%252Fview%26_125_tabs1%3Dusers%26_125_tabs2%3D%26_125_tabs3%3D%26_125_cur%3D1%26_125_delta%3D20%26_125_keywords%3D%26_125_advancedSearch%3Dfalse%26_125_andOperator%3Dtrue%26_125_emailAddress%3D%26_125_firstName%3D%26_125_lastName%3D%26_125_middleName%3D%26_125_organizationId%3D0%26_125_roleId%3D0%26_125_screenName%3D%26_125_userGroupId%3D0%26_125_orderByCol%3Dlast-name%26_125_orderByType%3Dasc&p_p_id=145&p_p_state=maximized&p_p_mode=view&_125_p_u_i_d=10168&_125_receiverslistTypeId=1
I've tried it also with liferay-portlet tag instead of portlet tag:
<liferay-portlet:actionURL var="sendMailURL">
<portlet:param name="struts_action" value="/messaging/send/back" />
<portlet:param name="redirect" value="<%= redirect %>" />
<portlet:param name="p_p_id" value="145"/>
<portlet:param name="p_p_state" value="maximized"></portlet:param>
<portlet:param name="p_p_mode" value="view"/>
<portlet:param name="p_u_i_d" value="<%= String.valueOf(userId) %>" />
<portlet:param name="receiverslistTypeId" value="1"/>
</liferay-portlet:actionURL>
But it's the same link and error.
Do I have to change to the tag, so that I can link from that portlet to my own Portlet (Messaging)?
Any ideas how to solve that problem, or what the problem could be?
Thanks for any help.
Hi Manuel,
change your <portlet-action> tag as follows:
<liferay-portlet:actionURL name="yourLinkName" plid="someNumber" portletName="xxx_WAR_yyyy" var="prueba2">
<%-- here your paramters --%>
</liferay-portlet:actionURL>
plid number of your portal can be found in the source-code of your jsp page, when you are viewing your page. Usually looks like this:
getPlid:function(){return"xxxx"}
and xxx_WAR_yyyy is the name of your war file. You can also find it in any links inside your portlet.
Have fuN!
change your <portlet-action> tag as follows:
<liferay-portlet:actionURL name="yourLinkName" plid="someNumber" portletName="xxx_WAR_yyyy" var="prueba2">
<%-- here your paramters --%>
</liferay-portlet:actionURL>
plid number of your portal can be found in the source-code of your jsp page, when you are viewing your page. Usually looks like this:
getPlid:function(){return"xxxx"}
and xxx_WAR_yyyy is the name of your war file. You can also find it in any links inside your portlet.
Have fuN!
Hi Puj,
thanks for your help.
Now I have the link in a jsp in control panel to a jsp in my own portlet.
Regards Manuel
thanks for your help.
Now I have the link in a jsp in control panel to a jsp in my own portlet.
Regards Manuel
Community
Company
Feedback