Package org.ocpsoft.rewrite.servlet.util
Class ContextUtil
java.lang.Object
org.ocpsoft.rewrite.servlet.util.ContextUtil
Utility method for easily interacting with the
ServletContext- Author:
- Lincoln Baxter, III
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetInitParam(jakarta.servlet.ServletContext context, String name) Retrieve the named context-parameter from the givenServletContext.static StringgetInitParam(jakarta.servlet.ServletContext context, String name, String deflt) Retrieve the named context-parameter from the givenServletContext.static booleangetInitParamBoolean(jakarta.servlet.ServletContext context, String name) Retrieve the named context-parameter from the givenServletContext.
-
Constructor Details
-
ContextUtil
public ContextUtil()
-
-
Method Details
-
getInitParamBoolean
Retrieve the named context-parameter from the givenServletContext. 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
Retrieve the named context-parameter from the givenServletContext. 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 givenServletContext. If the parameter is not defined, return the default value instead.
-