Mail Archive Home | exoplatform List | April 2007 Index
| <-- Date Index --> | <-- Thread Index --> |
Hi community,
I have a problem with a portlet I made for exo-ecm. I create a new page,
added a new container in this page with the edit page button, and then I add
my portlet in the container.
My portlet displays what I expect, but when I want to save the page, I get a
blank page on Firefox or Internet Explorer...
Even if I want to go back in the history pages, I get a blank page until I
am on the welcome page (when we are not connected).
So I don't understand what's happening, because I can see nothing on the
tomcat console ...
Moreover, my "Map" button is not displayed in the portlet but in the
container ...
My JSP page :
<html>
<%@ page language="java" %>
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="core" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>
<core:view>
<head>
<title>Map portlet</title>
</head>
<body>
<%
String userName = request.getRemoteUser();
if (userName.equals("exoadmin")) {%>
Exoadmin :
<html:form>
<html:commandButton action="exoadmin" value="Map"/>
</html:form>
<%} else {%>
User
<%}
%>
</body>
</core:view>
</html>
-------------------------------------------------------------------------------
My faces-config.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
</application>
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>exoadmin</from-outcome>
<to-view-id>/demo/index.html</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
-----------------------------------------------------------------------------------
My web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp_ID">
<display-name>MapPortlet</display-name>
<description>A map portlet</description>
<listener>
<listener-class>org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener</listener-class>
</listener>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>PortletWrapper</servlet-name>
<servlet-class>org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper</servlet-class>
</servlet>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PortletWrapper</servlet-name>
<url-pattern>/PortletWrapper</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tlds/portlet.tld</taglib-location>
</taglib>
</web-app>
------------------------------------------------------------------------------
My portlet.xml :
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description xml:lang="EN">A map portlet</description>
<portlet-name>MapPortlet</portlet-name>
<display-name xml:lang="EN">MapPortlet</display-name>
<portlet-class>org.sample.MapPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>MapPortlet</title>
<short-title>MapPortlet</short-title>
<keywords>MapPortlet</keywords>
</portlet-info>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>
---------------------------------------------------------------------------
The MapPortlet.java :
[...]
public class MapPortlet extends GenericPortlet {
public void init(PortletConfig pConfig) throws PortletException {
super.init(pConfig);
}
public void doView(RenderRequest portletRequest,
RenderResponse portletResponse) throws
PortletException,
IOException {
//WindowState state = portletRequest.getWindowState();
portletResponse.setContentType("text/html");
PortletContext context = getPortletContext();
PortletRequestDispatcher rd = context
.getRequestDispatcher("/index.jsp");
rd.include(portletRequest, portletResponse);
}
--------------------------------------------------------------------
Thanks for reading this mail,
Best regards,
CÃdric B.
--
View this message in context:
http://www.nabble.com/Blank-page-when-I-add-my-portlet-tf3607685.html#a10079748
Sent from the eXo Platform mailing list archive at Nabble.com.
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.