Class WebXmlFile


  • public class WebXmlFile
    extends java.lang.Object
    A utility class providing helper methods in dealing with web.xml
    Author:
    jcompagner, Juergen Donnerstag
    • Constructor Summary

      Constructors 
      Constructor Description
      WebXmlFile()
      Construct.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> getFilterPath​(boolean isServlet, java.lang.String filterName, java.io.InputStream is)
      Gets Wicket filter path via filter name and InputStream.
      java.util.Set<java.lang.String> getFilterPath​(boolean isServlet, javax.servlet.ServletContext servletContext, java.lang.String filterName)
      Gets Wicket filter path via ServletContext and the filter name
      java.lang.String getUniqueFilterPath​(boolean isServlet, java.lang.String filterName, java.io.InputStream is)
      Gets unique filter path via filter name and InputStream.
      java.lang.String getUniqueFilterPath​(boolean isServlet, javax.servlet.FilterConfig filterConfig)
      Gets unique Wicket filter path via FilterConfig
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebXmlFile

        public WebXmlFile()
        Construct.
    • Method Detail

      • getUniqueFilterPath

        public final java.lang.String getUniqueFilterPath​(boolean isServlet,
                                                          javax.servlet.FilterConfig filterConfig)
        Gets unique Wicket filter path via FilterConfig
        Parameters:
        isServlet - true if Servlet, false if Filter
        filterConfig -
        Returns:
        Filter path retrieved from "url-pattern". Null if not found or error occurred
      • getFilterPath

        public final java.util.Set<java.lang.String> getFilterPath​(boolean isServlet,
                                                                   javax.servlet.ServletContext servletContext,
                                                                   java.lang.String filterName)
        Gets Wicket filter path via ServletContext and the filter name
        Parameters:
        isServlet - true if Servlet, false if Filter
        servletContext -
        filterName -
        Returns:
        Filter paths retrieved from "url-pattern"
      • getUniqueFilterPath

        public final java.lang.String getUniqueFilterPath​(boolean isServlet,
                                                          java.lang.String filterName,
                                                          java.io.InputStream is)
                                                   throws javax.xml.parsers.ParserConfigurationException,
                                                          org.xml.sax.SAXException,
                                                          java.io.IOException
        Gets unique filter path via filter name and InputStream.
        Parameters:
        isServlet - true if Servlet, false if Filter
        filterName -
        is - The web.xml file
        Returns:
        Filter path retrieved from "url-pattern". Null if not found.
        Throws:
        javax.xml.parsers.ParserConfigurationException
        java.io.IOException
        org.xml.sax.SAXException
        See Also:
        getFilterPath(boolean, String, java.io.InputStream)
      • getFilterPath

        public final java.util.Set<java.lang.String> getFilterPath​(boolean isServlet,
                                                                   java.lang.String filterName,
                                                                   java.io.InputStream is)
                                                            throws javax.xml.parsers.ParserConfigurationException,
                                                                   org.xml.sax.SAXException,
                                                                   java.io.IOException
        Gets Wicket filter path via filter name and InputStream. The InputStream is assumed to be an web.xml file.

        A typical Wicket web.xml entry looks like:

         
         <filter>
           <filter-name>HelloWorldApplication</filter-name>
           <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
           <init-param>
             <param-name>applicationClassName</param-name>
             <param-value>org.apache.wicket.examples.helloworld.HelloWorldApplication</param-value>
           </init-param>
         </filter>
         
         <filter-mapping>
           <filter-name>HelloWorldApplication</filter-name>
           <url-pattern>/helloworld/*</url-pattern>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
         </filter-mapping>
         
         
        Parameters:
        isServlet - true if Servlet, false if Filter
        filterName -
        is - The web.xml file
        Returns:
        Filter paths retrieved from "url-pattern".
        Throws:
        javax.xml.parsers.ParserConfigurationException
        java.io.IOException
        org.xml.sax.SAXException