Package freemarker.ext.servlet
Class ServletContextHashModel
java.lang.Object
freemarker.ext.servlet.ServletContextHashModel
- All Implemented Interfaces:
TemplateHashModel
,TemplateModel
TemplateHashModel wrapper for a ServletContext attributes.
-
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
Constructor Summary
ConstructorsConstructorDescriptionServletContextHashModel
(javax.servlet.GenericServlet servlet, ObjectWrapper wrapper) ServletContextHashModel
(javax.servlet.ServletContext servletctx, ObjectWrapper wrapper) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionGets a TemplateModel from the hash.javax.servlet.GenericServlet
Returns the underlying servlet.boolean
isEmpty()
-
Constructor Details
-
ServletContextHashModel
-
ServletContextHashModel
@Deprecated public ServletContextHashModel(javax.servlet.ServletContext servletctx, ObjectWrapper wrapper) Deprecated.
-
-
Method Details
-
get
Description copied from interface:TemplateHashModel
Gets a TemplateModel from the hash.- Specified by:
get
in interfaceTemplateHashModel
- Parameters:
key
- the name by which the TemplateModel is identified in the template.- Returns:
- the TemplateModel referred to by the key, or null if not found.
- Throws:
TemplateModelException
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceTemplateHashModel
-
getServlet
public javax.servlet.GenericServlet getServlet()Returns the underlying servlet. Can return null if this object was created using the deprecated constructor.
-
ServletContextHashModel(GenericServlet, ObjectWrapper)
instead.