public class ServletRepositoryFactory extends Object implements RepositoryFactory
The default name of the repository attribute is
"javax.jcr.Repository
", but it can be changed by specifying
an init parameter with the same name:
<servlet> <init-param> <param-name>javax.jcr.Repository</param-name> <param-value>my.repository.attribute</param-value> <description> This init parameter causes the repository to be looked up from the "my.repository.attribute" attribute instead of the default "javax.jcr.Repository". </description> </init-param> </servlet>
Constructor and Description |
---|
ServletRepositoryFactory(javax.servlet.GenericServlet servlet)
Creates a factory for looking up a repository from the context of
the given servlet.
|
Modifier and Type | Method and Description |
---|---|
Repository |
getRepository()
Looks up and returns a repository bound in the configured servlet
context attribute.
|
public ServletRepositoryFactory(javax.servlet.GenericServlet servlet)
servlet
- servlet whose context contains the repositorypublic Repository getRepository() throws RepositoryException
getRepository
in interface RepositoryFactory
RepositoryException
- if the repository is not availableCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.