Skip to content

micromata/webjars-servlet-2.x

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webjars-servlet-2.x

Implements a Servlet to enable Webjars resources for Servlet 2.x API compliant Java EE containers that do not support the Servlet 3.x API

Usage

  1. Register Maven dependency:

    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>webjars-servlet-2.x</artifactId>
        <version>1.6</version>
    </dependency>
    
  2. Register servlet in your web.xml

    <!--Webjars Servlet-->
    <servlet>
        <servlet-name>WebjarsServlet</servlet-name>
        <servlet-class>org.webjars.servlet.WebjarsServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>WebjarsServlet</servlet-name>
        <url-pattern>/webjars/*</url-pattern>
    </servlet-mapping>
    
  3. If you want to disable webjars resources caching you can use the disableCache configuration property. Eg:

    <!--Webjars Servlet-->
    <servlet>
        <servlet-name>WebjarsServlet</servlet-name>
        <servlet-class>org.webjars.servlet.WebjarsServlet</servlet-class>
        <init-param>
            <param-name>disableCache</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    

About

Webjars for Servler 2.x compliant containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.4%
  • JavaScript 0.6%