public class ServletManager extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Enables the use of programmatically adding servlets to the given ServletContext.
Run during the ApplicationServers contextInitialized
phase, before starting servlets.
This ensures that all (dynamic) servlets
are created, before servlets are being created.
This in turn avoids a ConcurrentModificationException if this where to be done during a servlet
init phase.
When dtap.stage
is set to LOC, the default behaviour of each servlet is not-secured (no authentication) on HTTP.
When dtap.stage
is NOT set to LOC, the default behaviour of each servlet is secured (authentication enforced) on HTTPS.
To change this behaviour the following properties can be used;
servlet.servlet-name.transportGuarantee
- forces HTTPS when set to CONFIDENTIAL, or HTTP when set to NONE
servlet.servlet-name.securityRoles
- use the default IBIS roles or create your own
servlet.servlet-name.urlMapping
- path the servlet listens to
servlet.servlet-name.loadOnStartup
- automatically load or use lazy-loading (affects application startup time)
Constructor and Description |
---|
ServletManager(javax.servlet.ServletContext servletContext) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
declareRoles(String... roleNames)
Register a new role
|
ServletConfiguration |
getServlet(String name) |
protected javax.servlet.ServletContext |
getServletContext() |
Collection<ServletConfiguration> |
getServlets() |
static javax.servlet.annotation.ServletSecurity.TransportGuarantee |
getTransportGuarantee(String propertyName) |
void |
register(ServletConfiguration config) |
void |
startAuthenticators() |
public ServletManager(javax.servlet.ServletContext servletContext)
protected javax.servlet.ServletContext getServletContext()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void startAuthenticators()
public void declareRoles(String... roleNames)
roleNames
- String or multiple strings of roleNames to registerpublic void register(ServletConfiguration config)
public ServletConfiguration getServlet(String name)
public Collection<ServletConfiguration> getServlets()
public static javax.servlet.annotation.ServletSecurity.TransportGuarantee getTransportGuarantee(String propertyName)
Copyright © 2023 Frank!Framework. All rights reserved.