Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tanaji Londhe
Redirect another page of a same Portlet.
August 23, 2012 12:25 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

Hi,
I have only one custom portlet having two pages (first.jsp & second.jsp).
I use following two ways in my action method.
1) actionResponse.sendRedirect("jspPage", "/second.jsp");
It remains on the same page but particular action method is called successfully.
2) actionResponse.setRenderParameter("jspPage", "/second.jsp");
ERROR [PortletRequestDispatcherImpl:108] javax.servlet.ServletException: File "/second.jsp" not found
How can i redirect to my second page of a same portlet ?
Rewati Raman
RE: Redirect another page of a same Portlet.
August 23, 2012 2:26 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

Hi Tanaji,

just check your jsp files are inside docroot or docroot/<some package>

your first jsp and the second jsp might be inside some package inside docroot

so just check

as your 2nd way is correct if the jsp files are inside docroot

Regards,
Rewati Raman
Dhrutika Vyas
RE: Redirect another page of a same Portlet.
August 23, 2012 2:36 AM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

HI ,

I think you need to provide proper path of your jsp. or else you can try this way
<portlet:renderURL var="myURL">
<portlet:param name="jspPage" value="path to your jsp" />
</portlet:renderURL>

Regards,
Dhrutika
Tanaji Londhe
RE: Redirect another page of a same Portlet.
August 23, 2012 3:06 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

Rewati Raman:
Hi Tanaji,

just check your jsp files are inside docroot or docroot/<some package>

your first jsp and the second jsp might be inside some package inside docroot

so just check

as your 2nd way is correct if the jsp files are inside docroot

Regards,
Rewati Raman



this is my second page path : /linkDemo-portlet/docroot/html/newportlet/second.jsp
still its not working using 2nd way.
Rewati Raman
RE: Redirect another page of a same Portlet.
August 23, 2012 3:12 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

and what is the path of your firstjsp
that might be
/linkDemo-portlet/docroot/html/newportlet/first.jsp

you just have to give path after docroot
if your filestructure is like this

/linkDemo-portlet/docroot/html/newportlet/second.jsp
then write
1
2actionRespoonse.setRenderParameter("jspPage","/html/newportlet/second.jsp")


then it will work

Regards,
Rewati Raman
Tanaji Londhe
RE: Redirect another page of a same Portlet.
August 23, 2012 3:12 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

first jsp path : /linkDemo-portlet/docroot/html/newportlet/view.jsp
Here my both jsp pages are in same folder "newportlet"
Rewati Raman
RE: Redirect another page of a same Portlet.
August 23, 2012 3:22 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

Hi Drhutika,
do u have any sample portlet where you have used this method if possible send me the code portion of both java file as well as jsp

Regards,
Rewati Raman
Tanaji Londhe
RE: Redirect another page of a same Portlet.
August 23, 2012 3:22 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

Hi Rewati,
its working properly. Thanks emoticon