我有一个 JSP,比如说view.jsp
,它使用基本的 Liferay 搜索容器模式:
<liferay-ui:search-container>
<liferay-ui:search-form page="..." />
...
</liferay-ui:search-container>
假设 view.jsp 在 docroot/jsp 文件夹中,并且在同一个文件夹中,是我的搜索表单,search.jsp
. 现在,当我这样做时:
<liferay-ui:search-container>
<liferay-ui:search-form page="search.jsp" />
...
</liferay-ui:search-container>
页面正确呈现,但没有搜索表单。在控制台中,我注意到 ff. 例外:
08:11:01,937 ERROR [IncludeTag:154] java.lang.IllegalArgumentException: Path search.jsp does not start with a "/" character
at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:370)
at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:196)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:173)
at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:223)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:58)
...
如果我使用这样的绝对路径:
<liferay-ui:search-container>
<liferay-ui:search-form page="/jsp/search.jsp" />
...
</liferay-ui:search-container>
同样的事情发生了,但现在是例外:
08:21:21,796 ERROR [IncludeTag:154] javax.servlet.ServletException: File "/jsp/search.jsp" not found
at org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:335)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:175)
at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:223)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:58)
...
有谁知道如何解决这一问题?