public class ServletContextPropertyManager extends Object implements PropertyManager
PropertyManager
which checks the ServletContext.getInitParameter(java.lang.String)
method for properties. A call to getProperty(key)
will return
the value of
servletcontext.getInitParameter("org.faceless.pdf2."+key)
.
To use, add the following line (in bold) to the Servlet.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 your
WEB-INF/web.xml
. For example:
<web-app> <context-param> <param-name>org.faceless.pdf2.JavaScript</param-name> <param-value>none</param-value> </context-param> ...
SYSTEM
Constructor and Description |
---|
ServletContextPropertyManager(ServletContext context) |
Modifier and Type | Method and Description |
---|---|
String |
getProperty(String key)
Return the specified property, or
null if no such
property is set. |
URL |
getURLProperty(String key)
Return the specified property as a URL, or
null if no
such property is set. |
public ServletContextPropertyManager(ServletContext context)
public String getProperty(String key)
PropertyManager
null
if no such
property is set.getProperty
in interface PropertyManager
public URL getURLProperty(String key) throws MalformedURLException
PropertyManager
null
if no
such property is set.getURLProperty
in interface PropertyManager
MalformedURLException
Copyright © 2001-2017 Big Faceless Organization