Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
David Peng
link jsp failure
July 13, 2010 2:15 PM
Answer

David Peng

Rank: New Member

Posts: 21

Join Date: May 18, 2010

Recent Posts

Follow the online example, I try to enhance the view.jsp, and create the link from view.jsp to another jsp file (such as customer_add.jsp), but it failed to link to customer_add.jsp.
The pop up page URL is like this:
http://localhost:8080/web/guest/customer?p_p_id=customerportlet_WAR_customerportlet_INSTANCE_e12X&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_customerportlet_WAR_customerportlet_INSTANCE_e12X_jspPage=%2FWEB-INF%2Fjsp%2Fcustomer_add.jsp
It still show the same page as the portlet page, not the customer_add.jsp page.

The code is like this:

<A href="<portlet:renderURL><portlet:param name="jspPage" value="/WEB-INF/jsp/customer_add.jsp" /></portlet:renderURL>" target="_blank">Add New Customer</A>

I tested it with "/customer_add.jsp", has the same problem. I also has one link from inside the file, like this:

//row.addJSP("/customer_action.jsp", application, request, response);
row.addButton("edit", "/customer_edit.jsp");

none of them work, any suggestion is welcome.
Rishi Dev Gupta
RE: link jsp failure
July 13, 2010 9:20 PM
Answer

Rishi Dev Gupta

Rank: Expert

Posts: 255

Join Date: November 23, 2008

Recent Posts

Instead of directly opening a jsp, you should use portlet action to render another jsp with in same portlet or another one.

I don't think you will be able to open a jsp directly in liferay portal...
David Peng
RE: link jsp failure
July 14, 2010 6:45 AM
Answer

David Peng

Rank: New Member

Posts: 21

Join Date: May 18, 2010

Recent Posts

Any sample of how to link jsp file from view.jsp, or in general.
And the code was directly from the online sample "From DB to simple UI", but didn't work out.
Thanks.
Dave Weitzel
RE: link jsp failure
July 14, 2010 7:03 AM
Answer

Dave Weitzel

Rank: Regular Member

Posts: 169

Join Date: November 18, 2009

Recent Posts

I'm just learning Liferay and how to extend nd develop within it but this was one of the first things I did creating links between pages inside a portlet.

the code is:
<%
PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setParameter("jspPage", "/view2.jsp");
%>

I do not know why you are using target="_blank" as it is inside the portal.

I used this on two pages to move between the two. Also then use those page to understand how tags work just by displaying values etc.