Class ContextUtil

java.lang.Object
org.ocpsoft.rewrite.servlet.util.ContextUtil

public class ContextUtil extends Object
Utility method for easily interacting with the ServletContext
Author:
Lincoln Baxter, III
  • Constructor Details

    • ContextUtil

      public ContextUtil()
  • Method Details

    • getInitParamBoolean

      public static boolean getInitParamBoolean(jakarta.servlet.ServletContext context, String name)
      Retrieve the named context-parameter from the given ServletContext. If the parameter is not defined, return false, otherwise return the value as a boolean. If the value cannot be converted to a boolean type, return false.
    • getInitParam

      public static String getInitParam(jakarta.servlet.ServletContext context, String name)
      Retrieve the named context-parameter from the given ServletContext. If the parameter is not defined, return null.
    • getInitParam

      public static String getInitParam(jakarta.servlet.ServletContext context, String name, String deflt)
      Retrieve the named context-parameter from the given ServletContext. If the parameter is not defined, return the default value instead.