1

I have created a menu bar using html, css, lists etc. in Liferay.

The option on it are Home, Reports, User etc. When I click on each of them a sub menu appears.

here is an example. I have a menu bar with Home, Reports, User, Add and when I click on say Reports a sub menu appears which has Legal,Documents,Personal,Company. When I click on any of them the jsp page should appear. Ex. If I click on Reports and select Personal then Personal.jsp page should appear but it is not happening in my case.

The menubar.jsp has links to pages. ex:

<li>
    <a href="#">Reports</a>
    <ul>
        <li><a href="../admin/Legal.jsp">Legal</a></li>
        <li><a href="../admin/Documents.jsp">Documents</a></li>
        <li><a href="../admin/Personal.jsp">Personal</a></li>
        <li><a href="../admin/Company.jsp">Company</a></li>
    </ul>
</li>

When I try to access it the error that I am seeing is:

The webpage at http://localhost:8080/admin/Personal.jsp might be temporarily down or it may have moved permanently to a new web address.

Although my path is correct I get the above error. Also when I use:

<a href="../admin/Personal.jsp">Personal</a>

I am redirected to the same page. Instead When I use:

<a href="/admin/Personal.jsp">Personal</a>

I get the error mentioned above.

What is the solution?

4

1 回答 1

3

将评论转换为答案,不客气:)

您是在构建一个应该使用给定的 jsp 文件显示其内容的 portlet,还是在门户中运行,然后想要链接到门户之外的整页 jsps?在门户世界中,您不能只链接到某个 JSP。门户内部的解决方案在很大程度上取决于您实现 portlet 的框架。使用 Liferay MVC,您可以链接到

<a href="<portlet:renderURL>
            <portlet:param name="mvcPath" value="/admin/Personal.jsp"/>
         </portlet:renderURL>">Personal</a>

并且您正在实现的 portlet 将自动将此页面显示为其内容。

于 2013-05-04T12:04:53.917 回答