WorldWander logo
Main

The Road Behind

Venezuela
Trinidad
Curacao
Galapagos
Ecuador
Peru
Bolivia
Paraguay
Argentina
Chile
Hong Kong
Thailand North
Thailand South
Malaysia
Cambodia
Singapore
Nepal
Kathmandu
Royal Trek
Nepal Trek
India
India Palace
Udaipur
Bangalore
Greece
Islands
Rhodes
Camping
Olympia
Turkey
Istanbul
Bath
Bursa
Cappadocia
Bodrum
South Africa
Garden Route
Cape Town
Namibia
Fish River
Etosha
Botswana
Zimbabwe
Wedding
Great Ruins
Germany
Bathroom
Netherlands
Spain
Madrid
Seville
Granada
Gibraltar
Morocco
Portugal
Sintra
France
Normandy
Egypt
Pyramids
Nile
Aswan
Abusimbel
Luxor
Valley of Kings
Alexandria
Red Sea
Jordan
Kings Valley
Aman
Palestine

The Road Ahead

Isreal
Czech Republic
Austria
Italy
Switzerland
England
Find pages
Unused pages
Undefined pages
Page Index

Set your name in
UserPreferences


Referenced by
PageFilters
SpamFilter




JSPWiki v2.2.33


PageFilterConfiguration


How to add a new PageFilter to my JSPWiki?

Easy. Just follow the next few steps.

1. Add the JAR to your class path

Typically, a PageFilter is shipped in a JAR -file. You have to put this JAR -file in your CLASSPATH somehow so that Java can find it. The easiest way is to just drop it to your webapps/your wiki name/WEB-INF/lib -directory.

If you are using any of the Page Filters that ship within JSPWiki, then you don't have to perform this step - they are already in your class path.

2. Tell JSPWiki you want to use this filter

Find the "filters.xml" file in your webapps/your wiki name/WEB-INF/classes -directory. If you don't have one, create a new one as per the example below.

Example configuration file

<?xml version="1.0"?>

<pagefilters>

   <filter>
      <class>com.ecyrd.jspwiki.filters.ProfanityFilter</class>
   </filter>
   
   <filter>
      <class>com.ecyrd.jspwiki.filters.PingWeblogsComFilter</class>

      <param>
         <name>url</name>
         <value>http://rpc.weblogs.com/RPC2</value>
      </param>

   </filter>

</pagefilters>

Explanation on the different sections

You can define as many filter -sections as you like. You can also define the same filter multiple times, in case you want to run the same filter many times. For example, you might want to ping multiple places using the PingWeblogsComFilter.

The order of the filters is significant: The filters are executed in exactly the same order as they appear in the "filters.xml" -file, so if you have many filters that modify the pages, you should be wary of the side effects =).

The parameters to the filters are defined inside the param -sections. A parameter has a "name" and a "value", both being free-form strings. A parameter may only occur once, i.e. the same name may occur only once in the whole filter -section.

Using an alternate filters.xml

You can also set the location of the filters.xml -file from your jspwiki.properties-file. For example, to set it to a config file in your /usr/local/jspwiki/config-dir, try:

jspwiki.filterConfig = /usr/local/jspwiki/config/filters.xml

Back to PageFilters.




Go to top  
This page last changed on 08-Jun-2005 20:34:26 EDT by unknown.
Please make one.