Package org.owasp.csrfguard
Class CsrfGuardServletContextListener
- java.lang.Object
-
- org.owasp.csrfguard.CsrfGuardServletContextListener
-
- All Implemented Interfaces:
EventListener,javax.servlet.ServletContextListener
public class CsrfGuardServletContextListener extends Object implements javax.servlet.ServletContextListener
-
-
Constructor Summary
Constructors Constructor Description CsrfGuardServletContextListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextDestroyed(javax.servlet.ServletContextEvent event)voidcontextInitialized(javax.servlet.ServletContextEvent event)static StringgetConfigFileName()config file name if specified in the web.xmlstatic StringgetServletContext()servlet context (will be the empty string if it is / )static voidprintConfigIfConfigured(javax.servlet.ServletContext context, String prefix)Prints the configuration to the ServletContext log file with the given prefix.
-
-
-
Method Detail
-
getServletContext
public static String getServletContext()
servlet context (will be the empty string if it is / )- Returns:
- the servletContext
-
getConfigFileName
public static String getConfigFileName()
config file name if specified in the web.xml- Returns:
- config file name
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)
- Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener
-
printConfigIfConfigured
public static void printConfigIfConfigured(javax.servlet.ServletContext context, String prefix)Prints the configuration to the ServletContext log file with the given prefix. Has no effect unless the CONFIG_PRINT_PARAM init parameter is "true."- Parameters:
context- The ServletContextprefix- The string used as a prefix when printing the configuration to the log- See Also:
ServletContext.log(String)
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event)
- Specified by:
contextDestroyedin interfacejavax.servlet.ServletContextListener
-
-