Package org.faceless.pdf2
Class ServletContextPropertyManager
- java.lang.Object
-
- org.faceless.pdf2.ServletContextPropertyManager
-
- All Implemented Interfaces:
PropertyManager
public class ServletContextPropertyManager extends java.lang.Object implements PropertyManager
Defines aPropertyManager
which checks theServletContext.getInitParameter(java.lang.String)
method for properties. A call togetProperty(key)
will return the value ofservletcontext.getInitParameter("org.faceless.pdf2."+key)
. To use, add the following line (in bold) to theServlet.init(javax.servlet.ServletConfig)
method of your servlet:public void init(ServletConfig config) throws ServletException { super.init(config); PDF.setPropertyManager(new ServletContextPropertyManager(config.getServletContext())); }
Then, set the properties you want to set in yourWEB-INF/web.xml
. For example:<web-app> <context-param> <param-name>org.faceless.pdf2.JavaScript</param-name> <param-value>none</param-value> </context-param> ...
- Since:
- 2.13.1
-
-
Field Summary
-
Fields inherited from interface org.faceless.pdf2.PropertyManager
SYSTEM
-
-
Constructor Summary
Constructors Constructor Description ServletContextPropertyManager(ServletContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getProperty(java.lang.String key)
Return the specified property, ornull
if no such property is set.java.net.URL
getURLProperty(java.lang.String key)
Return the specified property as a URL, ornull
if no such property is set.
-
-
-
Constructor Detail
-
ServletContextPropertyManager
public ServletContextPropertyManager(ServletContext context)
-
-
Method Detail
-
getProperty
public java.lang.String getProperty(java.lang.String key)
Description copied from interface:PropertyManager
Return the specified property, ornull
if no such property is set.- Specified by:
getProperty
in interfacePropertyManager
-
getURLProperty
public java.net.URL getURLProperty(java.lang.String key) throws java.net.MalformedURLException
Description copied from interface:PropertyManager
Return the specified property as a URL, ornull
if no such property is set.- Specified by:
getURLProperty
in interfacePropertyManager
- Throws:
java.net.MalformedURLException
-
-