Fórum

call jsp from one portlet to jsp of another portlet

Priya Pratheep, modificado 11 Anos atrás.

call jsp from one portlet to jsp of another portlet

Junior Member Postagens: 38 Data de Entrada: 14/03/13 Postagens Recentes
I am very new to lifray.Pls help me to do the below problem.
I want to call jsp page project_costingsheet2.jsp which is in portletName ( apseprojectmgmtportlet_WAR_apseprojectmgmtportlet) from the jsp project-report-actual.jsp which is in portletName ( apse-projectreport-portlet) and pass some parameters with it.

In struts-config.xml
<action attribute="projectCostingSheetForm2" name="DynaFormBean" path="/apse-projectmgmt-portlet/projectCostingSheetAction2" type="com.bmtap.apse.projectmgmt.action.ProjectMgmtAction">
			<forward name="continue" path="/jsp/project_costingsheet2.jsp"></forward>
</action>


how can do this?

I tried

1.
&lt;%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %&gt;

2.
<liferay-portlet:renderurl var="linkURL" portletname="apseprojectmgmtportlet_WAR_apseprojectmgmtportlet" windowstate="maximized">
						<liferay-portlet:param name="struts_action" value="/projectCostingSheetAction2" />
						</liferay-portlet:renderurl>"&gt; 


Something is happening but not what I want.The url for above jsp code is
http://localhost:8080/web/bmt-asia-pacific-singapore/project-consolidated-report1?p_p_id=apseprojectmgmtportlet_WAR_apseprojectmgmtportlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_apseprojectmgmtportlet_WAR_apseprojectmgmtportlet_struts_action=%2FprojectCostingSheetAction2

Thanks in advance...
thumbnail
Anil Sunkari, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Expert Postagens: 427 Data de Entrada: 12/08/09 Postagens Recentes
HI Priya,

You can achive it through IPC. Follow the below URL and search for IPC.

http://www.liferay.com/community/liferay-projects/liferay-faces/demos#jsf2-ipc-events-bookings-portlet

You can get more help from Forums.

Regards,
Anil Sunari
thumbnail
Rahul Pande, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Expert Postagens: 310 Data de Entrada: 07/07/10 Postagens Recentes
HI Priya,

In order to use <liferay-portlet:renderURL> you have to put following property in both portlet's liferay-portlet.xml file

<add-default-resource>true</add-default-resource>

Thanks
Rahul
Priya Pratheep, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Junior Member Postagens: 38 Data de Entrada: 14/03/13 Postagens Recentes
Thank you Rahul ..

your answer give me some hope ..Now my error is


Internal Server Error

An error occurred while accessing the requested resource.

http://localhost:8080/web/xxx-asia-pacific-singapore/project-consolidated-report1?p_auth=6H5mtZlu&p_p_auth=CCOiX9Df&p_p_id=apseprojectmgmtportlet_WAR_apseprojectmgmtportlet_INSTANCE_7wDq&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_apseprojectmgmtportlet_WAR_apseprojectmgmtportlet_INSTANCE_7wDq_struts_action=%2Fapse-projectmgmt-portlet%2FprojectCostingSheetAction2&_apseprojectmgmtportlet_WAR_apseprojectmgmtportlet_INSTANCE_7wDq_id=119&_apseprojectmgmtportlet_WAR_apseprojectmgmtportlet_INSTANCE_7wDq_pro_id=300041

« Back

Thanks in advance
Priya Pratheep, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Junior Member Postagens: 38 Data de Entrada: 14/03/13 Postagens Recentes
Hi friends,

I am writing again my problem more clearer after searching a lot.

I have two portlet
1. apse_projectreport_portlet
2 .apse-projectmgmt-portlet

From jsp page project-report-actual.jsp of apse_projectreport_portlet I need to call the jsp page project_costingsheet2.jsp.

In apse-projectmgmt-portlet i am using structs form parameters to pass some variable. apse_projectreport_portlet we are not using any struts.

In project-report-actual.jsp( apse_projectreport_portlet)
	
	<liferay-portlet:actionurl var="linkURL" portletname="apseprojectmgmtportlet_WAR_apseprojectmgmtportlet_INSTANCE_7wDq" windowstate="maximized">
				<portlet:param name="struts_action" value="/apse-projectmgmt-portlet/projectCostingSheetAction2" />
				<portlet:param name="id" value="119" />
				<portlet:param name="pro_id" value="300041" />
	</liferay-portlet:actionurl>"&gt; 
	<a href="<%= linkURL%>">link to document library</a>
      	


and
&lt;%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %&gt;


In apse-projectmgmt-portlet

structs-config.xml

<action attribute="projectCostingSheetForm2" name="DynaFormBean" path="/apse-projectmgmt-portlet/projectCostingSheetAction2" type="com.bmtap.apse.projectmgmt.action.ProjectMgmtAction">
			<forward name="continue" path="/jsp/project_costingsheet2.jsp"></forward>
</action>


In ProjectMgmtAction.java

public class ProjectMgmtAction extends Action{

public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception{
		
		logger.debug("----------------------- inside ProjectMgmtAction --------------------------------");
		if (form!=null)
			logger.debug("form = " +form.getClass().toString());
		else
			logger.debug("form=null");
		if (form==null){
			String userid = request.getRemoteUser();
			logger.debug("userid = " +userid);
			request.setAttribute("APSE_USER_ID", userid);
		}
		else if (form instanceof DynaActionForm){
			logger.debug("----------------------- inside DynaActionForm --------------------------------");
			
			DynaActionForm actionform=(DynaActionForm)form;
		
		    String procode = (String)actionform.get("procode");
			request.setAttribute("procode", procode);			
			String marketsegmentid = (String)actionform.get("marketsegmentid");
			request.setAttribute("marketsegmentid", marketsegmentid);

In

In project_costingsheet2.jsp i usally receive through this

document.projectListForm.procode.value = procode;


I am very new to liferay .

Thanks in advance
thumbnail
Rahul Pande, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Expert Postagens: 310 Data de Entrada: 07/07/10 Postagens Recentes
Hi Priya,

As per this error, it seems apseprojectmgmtportlet portlet is instantiable and you are passing id of non instantiable portlet while creating the URL.
Please make apseprojectmgmtportlet non instantiable and try again.

Thanks
Rahul
Priya Pratheep, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Junior Member Postagens: 38 Data de Entrada: 14/03/13 Postagens Recentes
Thanks Rahul,

When I <instanceable>false</instanceable> in apseprojectmgmtportlet , Page can load but not loading any data
getting error message

14:46:24,416 INFO [PortalImpl:3812] Current URL /web/xxx-asia-pacific-singapore
/null/apse-projectmgmt-portlet/DepartmentSelectAllServlet generates exception: n
ull



Not only that If i try to load apseprojectmgmtportlet directly(not from other portlet) , it is showing the same error(loading page without data)...
Again thanks a lot for responce

Regards
Priya
thumbnail
Rahul Pande, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Expert Postagens: 310 Data de Entrada: 07/07/10 Postagens Recentes
Hi Priya,

You deployed apseprojectmgmtportlet by making it non instantiable. Please go to page where you put this portlet, delete old portlet and put the new deployed portlet.


Thanks
Rahul
Priya Pratheep, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Junior Member Postagens: 38 Data de Entrada: 14/03/13 Postagens Recentes
Hi Rahul,

After deleteing apseprojectmgmtportlet from deployment folder i am getting the error

15:09:23,476 INFO [PortalImpl:3812] Current URL /web/bmt-asia-pacific-singapore
/null/apse-projectmgmt-portlet/ProjectSelectServlet generates exception: null
15:09:23,477 INFO [PortalImpl:3824]

Page is loading with no data.The page is not loading from directly ...

error at firefox console is

"NetworkError: 404 Not Found - http://localhost:8080/web/xxx-asia-pacific-singapore/null/apse-projectmgmt-portlet/ProjectSelectServlet"

Thanks in advance
REgards
priya
thumbnail
Rahul Pande, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet (Resposta)

Expert Postagens: 310 Data de Entrada: 07/07/10 Postagens Recentes
Hi Priya,

You make portlet instantiable / non instantiable by specifying <instanceable>false</instanceable> in liferay-portlet.xml.

This and portlet.xml file is loaded when you put the portlet on a page.

Previously you had instantiable portlet on a page, so this portlet with some instance id is associated with that page (apseprojectmgmtportlet_WAR_apseprojectmgmtportlet _instace id ).

When you made that portlet non instantiable and visited the same page again, you were not able to see the portlet. Because page is associated with particular instance of that portlet and deployed portlet is non instantiable. To overcome this problem please try following steps.

1. Deploy the portlet by making it instantiable again.
2. Visit the page (You should be able to see the portlet again).
3. Delete the portlet from the page
4. Make portlet non instantiable and deploy.
5. Visit the page and put the new portlet again on the page. Verify the portlet id whether it is instantiable or non instantiable.

Thanks
Rahul
Priya Pratheep, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Junior Member Postagens: 38 Data de Entrada: 14/03/13 Postagens Recentes
Hi Rahul,

You are really GREAT ...WORKING .....

THANKS A LOT .....

Regards
Priya
thumbnail
Rahul Pande, modificado 11 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Expert Postagens: 310 Data de Entrada: 07/07/10 Postagens Recentes
Hi Priya,

Glad to know that its working.emoticon

Cheers emoticon

Thanks
Rahul
thumbnail
Akash Jaisawal, modificado 8 Anos atrás.

RE: call jsp from one portlet to jsp of another portlet

Regular Member Postagens: 141 Data de Entrada: 03/03/12 Postagens Recentes
Hi Priya...

Do you have any prototype for this same scenario ?

Regards