Skip to content

Commit

Permalink
Separate WebFilter from main library
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Mar 2, 2024
1 parent 1a2fdcf commit 7b01ebb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/hellowebapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ description = 'SiteMesh Example: Hello World Web-app'
dependencies {
// https://docs.oracle.com/javaee/6/javaserverfaces/2.0/docs/pdldocs/facelets/c/tld-summary.html
implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl:2.0.0'
implementation project(':sitemesh')
implementation project(':sitemesh-webfilter')
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gradleEnterprise {
}

rootProject.name = 'sitemesh3'
include ':sitemesh', ':sitemesh-examples-hellowebapp', ':sitemesh-examples-springboot', ':spring-boot-starter-sitemesh', ':sitemesh-examples-javalin'
include ':sitemesh', ':sitemesh-webfilter', ':sitemesh-examples-hellowebapp', ':sitemesh-examples-springboot', ':spring-boot-starter-sitemesh', ':sitemesh-examples-javalin'

project(':sitemesh-examples-hellowebapp').projectDir = file('examples/hellowebapp')
project(':sitemesh-examples-springboot').projectDir = file('examples/springboot')
Expand Down
11 changes: 11 additions & 0 deletions sitemesh-webfilter/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
id 'java-library'
}

ext.title = 'SiteMesh WebFilter'
description = 'SiteMesh WebFilter'

dependencies {
api 'jakarta.servlet:jakarta.servlet-api:6.0.0'
api project(':sitemesh')
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.sitemesh.config;

import jakarta.servlet.annotation.WebFilter;
import jakarta.servlet.DispatcherType;

@WebFilter(filterName="sitemesh", urlPatterns="/*",
dispatcherTypes = { DispatcherType.REQUEST, DispatcherType.ERROR } )
public class Sitemesh extends ConfigurableSiteMeshFilter {
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import java.util.Map;
import java.util.logging.Logger;

import jakarta.servlet.annotation.WebFilter;

/**
* A SiteMesh filter that can be dropped in to web.xml, that does not require having to write any Java code.
*
Expand Down Expand Up @@ -134,8 +132,6 @@
* @see PropertiesFilterConfigurator
*/

@WebFilter(filterName="configurableSiteMeshFilter", urlPatterns="/*",
dispatcherTypes = { DispatcherType.REQUEST, DispatcherType.ERROR } )
public class ConfigurableSiteMeshFilter implements Filter {

// TODO: This class could needs thorough unit-tests.
Expand Down

0 comments on commit 7b01ebb

Please sign in to comment.