Liferay - 简单的portlet问题

时间:2011-11-23 09:32:37

标签: liferay portlet

我正在尝试根据本教程运行我的第一个portlet: Liferay Developers Guide

我正在使用Liferay的6.0.6版本,这是我的代码。

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ page import="javax.portlet.PortletPreferences" %>

<portlet:defineObjects />
 <liferay-theme:defineObjects />
<%
     PortletPreferences prefs = renderRequest.getPreferences();
     String greeting = (String)prefs.getValue(
          "greeting", "Hello! Welcome to our portal.");
%>
<p><%= greeting %></p>
<portlet:renderURL var="editGreetingURL">
     <portlet:param name="jspPage" value="/edit.jsp" />
</portlet:renderURL>
<p><a href="<%= editGreetingURL %>">Edit greeting</a></p>

当我尝试运行时,我收到错误消息:

org.apache.jasper.JasperException: An exception occurred processing JSP page /view.jsp at line 8

5: <portlet:defineObjects />
6: <liferay-theme:defineObjects />
7: <%
8:  PortletPreferences prefs = renderRequest.getPreferences();
9:  String greeting = (String)prefs.getValue("greeting", "Hello! Welcome to our portal!");
10: %>
11: <p><%= greeting %></p>


Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53)
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:110)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53)
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53)
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53)
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53)

有谁知道我做错了什么?

1 个答案:

答案 0 :(得分:0)

删除tomcat中tmpwork个文件夹的内容,然后重试!