Foren

Liferay 6 :portlet:renderURL not redirecting

Ravi Kiran, geändert vor 12 Jahren.

Liferay 6 :portlet:renderURL not redirecting

Junior Member Beiträge: 53 Beitrittsdatum: 08.04.12 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

Expert Beiträge: 435 Beitrittsdatum: 09.02.09 Neueste Beiträge
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 ., geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

Liferay Master Beiträge: 522 Beitrittsdatum: 29.08.11 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

New Member Beiträge: 5 Beitrittsdatum: 02.03.12 Neueste Beiträge
try to move your /jsps/ folder from /WEB-INF/ to docroot/, and try again.
Ravi Kiran, geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

Junior Member Beiträge: 53 Beitrittsdatum: 08.04.12 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

Regular Member Beiträge: 159 Beitrittsdatum: 24.08.10 Neueste Beiträge
Hi Ravi,

Which class you are using for portlet-class in portlet.xml
Ravi Kiran, geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

Junior Member Beiträge: 53 Beitrittsdatum: 08.04.12 Neueste Beiträge
I am using my Custom Portlet class that extends GenericPortlet
Roshan Qureshi, geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

Regular Member Beiträge: 159 Beitrittsdatum: 24.08.10 Neueste Beiträge
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 ., geändert vor 12 Jahren.

RE: Liferay 6 :portlet:renderURL not redirecting

Liferay Master Beiträge: 522 Beitrittsdatum: 29.08.11 Neueste Beiträge
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