은 다음과 같다 배포 할 때 한 emty입니다 :포틀릿 나는 그것이 내가하는 Liferay 내 포틀릿 클래스를 사용하고
public class HospitalPortlet extends MVCPortlet {
private static Log _log = LogFactory.getLog(HospitalPortlet.class);
public void doLogin(ActionRequest actionRequest,
ActionResponse actionResponse)
throws IOException, PortletException{
actionRequest.setAttribute("test", "this is a test");
}
public void doView(RenderRequest renderRequest,
RenderResponse renderResponse)
throws IOException, PortletException{
renderRequest.setAttribute("test", "this is a test");
include("view.jsp", renderRequest, renderResponse);
}
public void include(String path,
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException{
PortletRequestDispatcher portletRequestDispatcher =
getPortletContext().getRequestDispatcher(path);
if (portletRequestDispatcher == null){
_log.error(path + " is not a valid include");
}
else{
portletRequestDispatcher.include(renderRequest, renderResponse);
}
}
}
내 viw.jsp은 다음과 같다 :
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<portlet:defineObjects />
This is the <b>Hospital</b> portlet.
<%
String testVar = (String)renderRequest.getAttribute("test");
%>
<br />
<p><%= testVar %></p>
내가이 포틀릿을 depoly 페이지에 배치하지만 비어 있으며 liferay 로그 파일에 오류 메시지가 없습니다. 그게 뭐가 잘못 되었 니?