Fórum

Liferay 6 :portlet:renderURL not redirecting

Ravi Kiran, modificado 12 Anos atrás.

Liferay 6 :portlet:renderURL not redirecting

Junior Member Postagens: 53 Data de Entrada: 08/04/12 Postagens Recentes
Hi ,
I am using Liferay 6 .

When i add the Portlet to the page , this page is shown first

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>

<portlet:defineObjects />

<portlet:renderURL var="homeurl">
<portlet:param name="jspPage" value="/WEB-INF/jsp/view1.jsp" />
</portlet:renderURL>

<portlet:renderURL var="homeurl2">
<portlet:param name="jspPage" value="/WEB-INF/jsp/view2.jsp" />
</portlet:renderURL>

<portlet:renderURL var="testUpdateURL">
<portlet:param name="jspPage" value="/WEB-INF/jsp/view3.jsp" />
</portlet:renderURL>

<p><a href="<%=homeurl%>" >
1. Go home
</a></p>

<p><a href="<%=homeurl2%>" >
2. Go home 2
</a></p>

<p><a href="<%=testUpdateURL%>" >
3. TestUpdate
</a></p>



This is view1.jsp

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>

<portlet:defineObjects />

This is the <b>view1</b> portlet.

Similarly the other JSP Pages , view2.jsp and view3.jsp are present


But when i click on any of the hyperlik displayed , nothing is happening , the same is being shown again .
thumbnail
Dhrutika Parekh, modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

Expert Postagens: 435 Data de Entrada: 09/02/09 Postagens Recentes
Hi Ravi,

There must be some error related to jsp path in backend.

Make sure your jsp's are at proper location. I tried with all jsp's at same level.

In view.jsp define jspPath as /view1.jsp and likewise.

You can also refer http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/writing-the-my-greeting-portlet.


Regards,
Dhrutika
thumbnail
Paul ., modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

Liferay Master Postagens: 522 Data de Entrada: 29/08/11 Postagens Recentes
That's because you have placed them in the WEB-INF directory which is a special directory for portal / app servers. Place them outside it and they should be working.
Jason Wan, modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

New Member Postagens: 5 Data de Entrada: 02/03/12 Postagens Recentes
try to move your /jsps/ folder from /WEB-INF/ to docroot/, and try again.
Ravi Kiran, modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

Junior Member Postagens: 53 Data de Entrada: 08/04/12 Postagens Recentes
Thanks for the replies . Currently i have placed my JSP files under docroot/WEB-INF/jsp folder

And this is defined inside the portlet.xml .

<init-param>
<name>viewNamespace</name>
<value>/jsp</value>
</init-param>

<init-param>
<name>view-jsp</name>
<value>/WEB-INF/jsp/view3.jsp</value>
</init-param>


Now please tell me , if i move jsp files outside the WEB-INF folder , what should i mention inside the viewNamespace in portlet.xml ??
Roshan Qureshi, modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

Regular Member Postagens: 159 Data de Entrada: 24/08/10 Postagens Recentes
Hi Ravi,

Which class you are using for portlet-class in portlet.xml
Ravi Kiran, modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

Junior Member Postagens: 53 Data de Entrada: 08/04/12 Postagens Recentes
I am using my Custom Portlet class that extends GenericPortlet
Roshan Qureshi, modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

Regular Member Postagens: 159 Data de Entrada: 24/08/10 Postagens Recentes
Ravi,

jspPage parameter is used in MVCPortlet so it will not work in your case as you are not using MVCPortlet class.
Either switch to MVCPortlet or copy the code from MVCPortlet to your custom portlet class for using jspPage parameter and redirecting to it.
thumbnail
Paul ., modificado 12 Anos atrás.

RE: Liferay 6 :portlet:renderURL not redirecting

Liferay Master Postagens: 522 Data de Entrada: 29/08/11 Postagens Recentes
Now please tell me , if i move jsp files outside the WEB-INF folder , what should i mention inside the viewNamespace in portlet.xml ??

Please enlighten me what is this "viewNamespace" meant for, is there any special use for it inside your portlet? I tried checking MVCPortlet class however could not found any specific use of this parameter.

I don't use it and it works fine. Still wondering what's it meant for emoticon