Foren

How to open one portlet jsp page inside the tab of other portlet

thumbnail
Chandan Sharma, geändert vor 9 Jahren.

How to open one portlet jsp page inside the tab of other portlet

Junior Member Beiträge: 54 Beitrittsdatum: 04.03.14 Neueste Beiträge
Hi All;

I have two portlet i.e.
  • Student-portlet
  • Course-portlet

I want to display "Course-portlet" jsp page inside tab of "Student-portlet" jsp page. But when I am including Course-portlet jsp page inside tab, it is showing "page not found".

I will appreciate all your help...

Thanks,
~Chandan
thumbnail
Jan Geißler, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Liferay Master Beiträge: 735 Beitrittsdatum: 05.07.11 Neueste Beiträge
Without some code and logs, it will be really tricky to help you there. Are those portlets in the same project? How do you include them? Please be a little bit more specific. Right now you are telling us:
"My car wont start. Please tell me how to fix it."
thumbnail
Chandan Sharma, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Junior Member Beiträge: 54 Beitrittsdatum: 04.03.14 Neueste Beiträge
Jan Geißler:
Without some code and logs, it will be really tricky to help you there. Are those portlets in the same project? How do you include them? Please be a little bit more specific. Right now you are telling us:
"My car wont start. Please tell me how to fix it."

emoticon yeah..
No both the portlets are in two different projects i.e.
  • Project-1 (Student-portlet)
  • Project-1 (Course-portlet)

Note: Please observe attachment to get structure of portlets
Now tab_1.jsp of (student-portlet) and tab_2.jsp of (course-portlet) I want to display as a tab inside Student-portlet. but when I am including tab_2.jsp, than it is showing resource undefined... as I am not getting how to locate the tab_2.jsp page.

Here is my sample code:

<c:if test="<%= tabs1.equals(&quot;Course&quot;) %>">
	<liferay-util:include page="/html/course/tab_2.jsp" servletcontext="<%=application %>"></liferay-util:include>
</c:if>

Anhänge:

thumbnail
Jan Geißler, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Liferay Master Beiträge: 735 Beitrittsdatum: 05.07.11 Neueste Beiträge
The include tag will try to include the jsp from the student project. That is because
<liferay-util:include page="/html/course/tab_2.jsp" servletContext="<%=application %>">
will look at the docroot of the current project. Which value is in <%=application %>? It should be something like "Course-portlet"
thumbnail
Chandan Sharma, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Junior Member Beiträge: 54 Beitrittsdatum: 04.03.14 Neueste Beiträge
Jan Geißler:
That is because
<liferay-util:include page="/html/course/tab_2.jsp" servletContext="<%=application %>">
will look at the docroot of the current project. Which value is in <%=application %>? It should be something like "Course-portlet"


yeah... I am looking for solution of that only. This thread question is targeted to find what way I can point JSP of other project portlet question ?
thumbnail
Jan Geißler, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Liferay Master Beiträge: 735 Beitrittsdatum: 05.07.11 Neueste Beiträge
Could you please answer this question?

Which value is in <%=application %>?
It should be something like "Course-portlet"

If it is not, try this:
<liferay-util:include page="/html/course/tab_2.jsp" servletContext="Course-portlet">

If its still throwing a FileNotFoundException please take a look at the path the file is not found, and show it to us.
thumbnail
Olaf Kock, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
My vote: Don't do this - don't make two plugins secretly dependent on each other by relying on specific JSPs being there. You'll just create a maintenance mess. If you *really* want to do it, package both in the same plugin - only then there is an argument to share JSPs.
thumbnail
Jan Geißler, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Liferay Master Beiträge: 735 Beitrittsdatum: 05.07.11 Neueste Beiträge
Olaf is right, I also would advise against it, BUT:
If you really wanna do it, there is a solution, even though you should not ;)
thumbnail
Olaf Kock, geändert vor 9 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
ssshhhhh - don't tell...
thumbnail
delang j, geändert vor 7 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Expert Beiträge: 252 Beitrittsdatum: 14.07.08 Neueste Beiträge
Olaf Kock:
ssshhhhh - don't tell...


hi olaf,

is it possible to include another jsp file from other portlet in the same project/war file.?
if yes, then how.

tq
thumbnail
delang j, geändert vor 7 Jahren.

RE: How to open one portlet jsp page inside the tab of other portlet

Expert Beiträge: 252 Beitrittsdatum: 14.07.08 Neueste Beiträge
nevermind, manage to solved it myself.

tq