[opencms-dev] OpenCMS + MyFaces

Atanas Atanasov show at dir.bg
Tue May 30 10:02:10 CEST 2006


Hello list,
I have problem with integration of OpenCMS and JSF.I have imported all
needed jars and tld and i can use the JSF tags without any problem but
something with paths is wrong.I can't use actions in jsp files because
CMS throws an exception:
The requested resource
"/opencms621-faces/WEB-INF/jsp/offline/system/modules/com.nitbg.rotoprint/templates/login.jsf"
was not found on the server.Why CMS load file from
"/WEB-INF/jsp/offline...."
This is my "web.xml".Is this the way?What is wrong?
<?xml version="1.0" encoding="ISO-8859-1"?>

<!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>

    <display-name>OpenCms</display-name>
    
    <description>
        OpenCms, the Open Source Content Management System.
        (c) 2005 Alkacon Software GmbH with contributions from the
OpenCms community.
        For more details about OpenCms, please see
http://www.opencms.org/.
        For more details about Alkacon Software GmbH, please see
http://www.alkacon.com/.
    </description>

    <context-param>
        <param-name>OpenCmsServlet</param-name>
        <param-value>/opencms/*</param-value>
    </context-param>
    
    <context-param>
        <param-name>DefaultWebApplication</param-name>
        <param-value>ROOT</param-value>
    </context-param>

    <context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/config/faces-config.xml</param-value>
    </context-param>
    
    <context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
    </context-param>

    <context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
    </context-param>
    
    <context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
    </context-param>
 
    <context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
    </context-param>
    
    <context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
    </context-param>
    
    <filter>
<filter-name>extensionsFilter</filter-name>

   <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
<description>Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
<description>Set the threshold size - files
below this limit are stored in memory, files above
this limit are stored on disk.

Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
</init-param>
    </filter>
    
    <filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    
    <filter>
<filter-name>trackFilter</filter-name>
<filter-class>com.nitbg.service.SessionTracker</filter-class>
    </filter>

    <filter-mapping>
<filter-name>trackFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    
    <listener>
        <listener-class>org.opencms.main.OpenCmsListener</listener-class>
    </listener>
    
    <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
        
   <servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>OpenCmsServlet</servlet-name>
        <description>
            The main servlet that handles all requests to the OpenCms
VFS.
        </description>
        <servlet-class>org.opencms.main.OpenCmsServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    
    <servlet>
        <servlet-name>OpenCmsServletErrorHandler</servlet-name>
        <description>
            The error handling servlet, also servers as trigger for
static export requests.
        </description>
        <servlet-class>org.opencms.main.OpenCmsServletErrorHandler</servlet-class>
        <load-on-startup>0</load-on-startup>
    </servlet>

    <servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>OpenCmsServlet</servlet-name>
        <url-pattern>/opencms/*</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
<servlet-name>OpenCmsServletErrorHandler</servlet-name>
<url-pattern>/opencms-errorhandler/*</url-pattern>
    </servlet-mapping>
    
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index_export.html</welcome-file>
    </welcome-file-list>
    
    <error-page>
        <error-code>404</error-code>
        <location>/opencms-errorhandler/handle404</location>
    </error-page>

<error-page>
        <error-code>500</error-code>
        <location>/opencms-errorhandler/system/handler/handle500.html</location>
    </error-page>
    
    <taglib>
        <taglib-uri>http://www.opencms.org/taglib/cms</taglib-uri>
        <taglib-location>/WEB-INF/opencms.tld</taglib-location>
    </taglib>

</web-app>



More information about the opencms-dev mailing list