留言板

Liferay 6 :portlet:renderURL not redirecting

Ravi Kiran,修改在12 年前。

Liferay 6 :portlet:renderURL not redirecting

Junior Member 帖子: 53 加入日期: 12-4-8 最近的帖子
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,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

Expert 帖子: 435 加入日期: 09-2-9 最近的帖子
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 .,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

Liferay Master 帖子: 522 加入日期: 11-8-29 最近的帖子
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,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

New Member 帖子: 5 加入日期: 12-3-2 最近的帖子
try to move your /jsps/ folder from /WEB-INF/ to docroot/, and try again.
Ravi Kiran,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

Junior Member 帖子: 53 加入日期: 12-4-8 最近的帖子
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,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

Regular Member 帖子: 159 加入日期: 10-8-24 最近的帖子
Hi Ravi,

Which class you are using for portlet-class in portlet.xml
Ravi Kiran,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

Junior Member 帖子: 53 加入日期: 12-4-8 最近的帖子
I am using my Custom Portlet class that extends GenericPortlet
Roshan Qureshi,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

Regular Member 帖子: 159 加入日期: 10-8-24 最近的帖子
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 .,修改在12 年前。

RE: Liferay 6 :portlet:renderURL not redirecting

Liferay Master 帖子: 522 加入日期: 11-8-29 最近的帖子
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