Wiki

Clone wiki

pretty-permalink-filter / Home

Page contents


Project notes

The Pretty Permalink Filter is a Java servlet filter which makes pretty permalinks of WordPress work on a Java web application server as expected.

This program is used in WordPress for Java EE by the author.

For more information about this program, visit the project page.

(Maven Central) (Sonatype Nexus)

(Inspecode report)

Deployment

First, place the JAR archive file of the class in the WEB-INF/lib directory of your web application. This program is CDI-ready and works instantly if CDI is enabled on the web application container.

Prerequisite

This filter is designed for the web application layout where all the top-level WordPress contents are located at the root of your web application without any subdirectory such as wordpress. If you can see the index.php file of WordPress and the WEB-INF directory in one directory, it is OK. If index.php is found under a subdirectory, this filter will not work as you expect.

With CDI

If your web application server supports CDI, place the (possibly empty) WEB-INF/beans.xml file in your web application. Java EE 7 and later servers may work without WEB-INF/beans.xml since Java EE 7 introduced implicit CDI.

Without CDI

If you cannot use CDI for some reasons (such as you are using plain Tomcat), you must add, in addition to the configuration for Quercus Servlet, several elements manually between <web-app> and </web-app> in the WEB-INF/web.xml file as below:

  <filter>
    <filter-name>Pretty Permalink Filter</filter-name>
    <filter-class>org.vx68k.servlet.permalink.PrettyPermalinkFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>Pretty Permalink Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

(The filter name may be different but the two must be the same.)

More documents

Installation.

Configuration.

Updated