[opencms-dev] How to use filters in OpenCMS module

Lubomir Kovac kovman at centrum.cz
Tue Jan 2 23:22:14 CET 2007


Hi,

I have created an javax.servlet.Filter in my module. I have created the 
Filter class, loaded to OpenCMS, published it as usually . I have 
registered this filter class to opencms web.xml as I usually do with web 
application. I have restarted the web server (Tomcat 5.5) but the only 
answer was:


      A server error occured!


        Server error 500


      Internal Server Error

The server encountered an unexpected condition which prevented it from 
fulfilling the request.

The server cannot complete the request because it encountered an error.

Please try it again in a few minutes, or contact the server administrator.

Powered by OpenCms - the open source content management system 
<http://www.opencms.org>


My class name is: cz.zcu.fav.FavLoadFilter.java

web.xml mapping I have added:
    <filter>
        <filter-name>FavLoadFilter</filter-name>
        <filter-class>cz.zcu.fav.filter.FavLoadFilter</filter-class>
    </filter>
    <filter-mapping>
         <filter-name>FavLoadFilter</filter-name>
         <url-pattern>/*</url-pattern>
    </filter-mapping>


1. Whats wrong?
2. Do I have to register it somewhere else?
3. When I export the module, how this filter setting will be exported? 
Does the importer needs to do some correction itself?
4. Is there any other way, how to work with filters? Or does something 
similar exist in OpenCMS?

I was looking around and didn't find a thing.

thanks for ideas

kovi :-).



More information about the opencms-dev mailing list