org.apache.wicket.util.file
Class WebXmlFile

java.lang.Object
  extended by org.apache.wicket.util.file.WebXmlFile

public class WebXmlFile
extends Object

A utility class providing helper methods in dealing with web.xml

Author:
jcompagner, Juergen Donnerstag

Constructor Summary
WebXmlFile()
          Construct.
 
Method Summary
 String getFilterPath(boolean isServlet, javax.servlet.FilterConfig filterConfig)
          Gets Wicket filter path via FilterConfig
 String getFilterPath(boolean isServlet, javax.servlet.ServletContext servletContext, String filterName)
          Gets Wicket filter path via ServletContext and the filter name
 String getFilterPath(boolean isServlet, String filterName, InputStream is)
          Gets Wicket filter path via filter name and InputStream.
 
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

getFilterPath

public final String getFilterPath(boolean isServlet,
                                  javax.servlet.FilterConfig filterConfig)
Gets 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 occured

getFilterPath

public final String getFilterPath(boolean isServlet,
                                  javax.servlet.ServletContext servletContext,
                                  String filterName)
Gets Wicket filter path via ServletContext and the filter name

Parameters:
isServlet - true if Servlet, false if Filter
servletContext -
filterName -
Returns:
Filter path retrieved from "url-pattern". Null if not found or error occured

getFilterPath

public final String getFilterPath(boolean isServlet,
                                  String filterName,
                                  InputStream is)
                           throws ParserConfigurationException,
                                  SAXException,
                                  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 path retrieved from "url-pattern". Null if not found.
Throws:
ParserConfigurationException
IOException
SAXException


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.