# Deprecated API

## Contents

- Interfaces
- Classes
- Fields
- Methods
- Constructors

Deprecated Interfaces
Interface
Description
org.apache.sling.api.request.builder.SlingHttpServletResponseResult
Use `SlingJakartaHttpServletResponseResult` instead
org.apache.sling.api.request.SlingRequestListener
Use `SlingJakartaRequestListener` instead.
org.apache.sling.api.resource.AttributableResourceProvider
Use the `ResourceProvider`
org.apache.sling.api.resource.DynamicResourceProvider
Use the `ResourceProvider`
org.apache.sling.api.resource.ModifyingResourceProvider
Use the `ResourceProvider`
org.apache.sling.api.resource.ParametrizableResourceProvider
Use the `ResourceProvider`
org.apache.sling.api.resource.PersistableValueMap
Use the `ModifiableValueMap` instead.
org.apache.sling.api.resource.QueriableResourceProvider
Use the `ResourceProvider`
org.apache.sling.api.resource.RefreshableResourceProvider
Use the `ResourceProvider`
org.apache.sling.api.resource.ResourceProvider
Use the `ResourceProvider`
org.apache.sling.api.resource.ResourceProviderFactory
org.apache.sling.api.scripting.SlingScriptResolver
The SlingScriptResolver interface is intended to be implemented and also used by project specific code. To keep the API as clean as possible this interface was deprecated
org.apache.sling.api.servlets.ErrorHandler
Use `JakartaErrorHandler` instead.
org.apache.sling.api.servlets.OptingServlet
Use `JakartaOptingServlet` instead
org.apache.sling.api.SlingHttpServletRequest
Use `SlingJakartaHttpServletRequest` instead.
org.apache.sling.api.SlingHttpServletResponse
Use `SlingJakartaHttpServletResponse` instead.

Deprecated Classes
Class
Description
org.apache.sling.api.request.header.MediaRangeList
Use `JakartaMediaRangeList` instead.
org.apache.sling.api.request.SlingRequestEvent
Use `SlingJakartaRequestEvent` instead.
org.apache.sling.api.servlets.HtmlResponse
use org.apache.sling.servlets.post.HtmlResponse instead.
org.apache.sling.api.servlets.SlingAllMethodsServlet
Use `SlingJakartaAllMethodsServlet` instead
org.apache.sling.api.servlets.SlingSafeMethodsServlet
Use `SlingJakartaSafeMethodsServlet` instead
org.apache.sling.api.wrappers.CompositeValueMap
Use `ValueMapUtil.merge(ValueMap...)` instead. Note that it does not support the parameter `merge = false`. However, this could easily be achieved with another decorator that restricts the set of allowed keys.
org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper
Use `SlingJakartaHttpServletRequestWrapper`
org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper
Use `SlingJakartaHttpServletResponseWrapper`

Deprecated Fields
Field
Description
org.apache.sling.api.resource.ResourceMetadata.INTERNAL_CONTINUE_RESOLVING
This flag is not supported anymore when implementing the SPI based `org.apache.sling.spi.resource.provider.ResourceProvider`
org.apache.sling.api.resource.ResourceResolver.REQUEST_ATTR_WORKSPACE_INFO
org.apache.sling.api.scripting.SlingBindings.REQUEST
Use `SlingBindings.JAKARTA_REQUEST` instead.
org.apache.sling.api.scripting.SlingBindings.RESPONSE
Use `SlingBindings.JAKARTA_RESPONSE` instead.
org.apache.sling.api.SlingConstants.ATTR_INCLUDE_CONTEXT_PATH
Use `RequestDispatcher.INCLUDE_CONTEXT_PATH` instead
org.apache.sling.api.SlingConstants.ATTR_INCLUDE_PATH_INFO
Use `RequestDispatcher.INCLUDE_PATH_INFO` instead
org.apache.sling.api.SlingConstants.ATTR_INCLUDE_QUERY_STRING
Use `RequestDispatcher.INCLUDE_QUERY_STRING` instead
org.apache.sling.api.SlingConstants.ATTR_INCLUDE_REQUEST_URI
Use `RequestDispatcher.INCLUDE_REQUEST_URI` instead
org.apache.sling.api.SlingConstants.ATTR_INCLUDE_SERVLET_PATH
Use `RequestDispatcher.INCLUDE_SERVLET_PATH` instead
org.apache.sling.api.SlingConstants.ATTR_REQUEST_SERVLET
Use `SlingConstants.ATTR_REQUEST_JAKARTA_SERVLET` instead
org.apache.sling.api.SlingConstants.ERROR_EXCEPTION
Use `RequestDispatcher.ERROR_EXCEPTION` instead
org.apache.sling.api.SlingConstants.ERROR_EXCEPTION_TYPE
Use `RequestDispatcher.ERROR_EXCEPTION_TYPE` instead
org.apache.sling.api.SlingConstants.ERROR_MESSAGE
Use `RequestDispatcher.ERROR_MESSAGE` instead
org.apache.sling.api.SlingConstants.ERROR_REQUEST_URI
Use `RequestDispatcher.ERROR_REQUEST_URI` instead
org.apache.sling.api.SlingConstants.ERROR_SERVLET_NAME
Use `RequestDispatcher.ERROR_SERVLET_NAME` instead
org.apache.sling.api.SlingConstants.ERROR_STATUS
Use `RequestDispatcher.ERROR_STATUS_CODE` instead
org.apache.sling.api.SlingConstants.PROPERTY_ADAPTABLE_CLASSES
Use a service listener listening for service removed events for `org.apache.sling.adapter.Adaption`.
org.apache.sling.api.SlingConstants.PROPERTY_ADAPTER_CLASSES
Use a service listener listening for service removed events for `org.apache.sling.adapter.Adaption`.
org.apache.sling.api.SlingConstants.TOPIC_ADAPTER_FACTORY_ADDED
Use a service listener listening for service removed events for `org.apache.sling.adapter.Adaption`.
org.apache.sling.api.SlingConstants.TOPIC_ADAPTER_FACTORY_REMOVED
Use a service listener listening for service removed events for `org.apache.sling.adapter.Adaption`.
org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED
Register a `ResourceChangeListener` instead
org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_CHANGED
Register a `ResourceChangeListener` instead
org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_REMOVED
Register a `ResourceChangeListener` instead
org.apache.sling.api.wrappers.SlingRequestPaths.INCLUDE_CONTEXT_PATH
Use `RequestDispatcher.INCLUDE_CONTEXT_PATH`
org.apache.sling.api.wrappers.SlingRequestPaths.INCLUDE_PATH_INFO
Use `RequestDispatcher.INCLUDE_PATH_INFO`
org.apache.sling.api.wrappers.SlingRequestPaths.INCLUDE_QUERY_STRING
Use `RequestDispatcher.INCLUDE_QUERY_STRING`
org.apache.sling.api.wrappers.SlingRequestPaths.INCLUDE_REQUEST_URI
Use `RequestDispatcher.INCLUDE_REQUEST_URI`
org.apache.sling.api.wrappers.SlingRequestPaths.INCLUDE_SERVLET_PATH
Use `RequestDispatcher.INCLUDE_SERVLET_PATH`

Deprecated Methods
Method
Description
org.apache.sling.api.auth.Authenticator.login(HttpServletRequest, HttpServletResponse)
Use `Authenticator.login(HttpServletRequest, HttpServletResponse)` instead.
org.apache.sling.api.auth.Authenticator.logout(HttpServletRequest, HttpServletResponse)
Use `Authenticator.logout(HttpServletRequest, HttpServletResponse)` instead.
org.apache.sling.api.request.builder.SlingHttpServletRequestBuilder.build()
Use `SlingHttpServletRequestBuilder.buildJakartaRequest()` instead
org.apache.sling.api.request.builder.SlingHttpServletRequestBuilder.useAttributesFrom(HttpServletRequest)
Use `SlingHttpServletRequestBuilder.useAttributesFrom(HttpServletRequest)` instead
org.apache.sling.api.request.builder.SlingHttpServletRequestBuilder.useRequestDispatcherFrom(SlingHttpServletRequest)
Use `SlingHttpServletRequestBuilder.useRequestDispatcherFrom(SlingJakartaHttpServletRequest)` instead
org.apache.sling.api.request.builder.SlingHttpServletRequestBuilder.useServletContextFrom(HttpServletRequest)
Use `SlingHttpServletRequestBuilder.useServletContextFrom(HttpServletRequest)` instead
org.apache.sling.api.request.builder.SlingHttpServletRequestBuilder.useSessionFrom(HttpServletRequest)
Use `SlingHttpServletRequestBuilder.useSessionFrom(HttpServletRequest)` instead
org.apache.sling.api.request.builder.SlingHttpServletResponseBuilder.build()
Use `SlingHttpServletResponseBuilder.buildJakartaResponseResult()` instead
org.apache.sling.api.request.RequestUtil.getServletName(Servlet)
Use `RequestUtil.getServletName(Servlet)`
org.apache.sling.api.request.RequestUtil.handleIfModifiedSince(SlingHttpServletRequest, HttpServletResponse)
Use `RequestUtil.handleIfModifiedSince(SlingJakartaHttpServletRequest, HttpServletResponse)` instead.
org.apache.sling.api.request.RequestUtil.setRequestAttribute(HttpServletRequest, String, Object)
Use `RequestUtil.setRequestAttribute(HttpServletRequest, String, Object)`
org.apache.sling.api.resource.mapping.ResourceMapper.getAllMappings(String, HttpServletRequest)
Use `ResourceMapper.getAllMappings(String, HttpServletRequest)` instead.
org.apache.sling.api.resource.mapping.ResourceMapper.getMapping(String, HttpServletRequest)
Use `ResourceMapper.getMapping(String, HttpServletRequest)` instead.
org.apache.sling.api.resource.observation.ResourceChange.getAddedPropertyNames()
As there is no guarantee that this information is contained in the change event, this should not be used anymore.
org.apache.sling.api.resource.observation.ResourceChange.getChangedPropertyNames()
As there is no guarantee that this information is contained in the change event, this should not be used anymore.
org.apache.sling.api.resource.observation.ResourceChange.getRemovedPropertyNames()
As there is no guarantee that this information is contained in the change event, this should not be used anymore.
org.apache.sling.api.resource.ResourceDecorator.decorate(Resource, HttpServletRequest)
since 2.3.0 (and JCR Resource 2.1.0), this method will not be invoked.
org.apache.sling.api.resource.ResourceProvider.getResource(ResourceResolver, HttpServletRequest, String)
since 2.2.0 (and JCR Resource 2.1.0), this method will not be invoked.
org.apache.sling.api.resource.ResourceProviderFactory.getAdministrativeResourceProvider(Map<String, Object>)
as of 2.4 (bundle version 2.5.0) because of inherent security issues. Implementations may implement this method at their discretion but must support the new service based resource provider generation in the `ResourceProviderFactory.getResourceProvider(Map)` method honoring the `ResourceProviderFactory.SERVICE_BUNDLE` and `ResourceResolverFactory.SUBSERVICE` properties.
org.apache.sling.api.resource.ResourceResolver.map(HttpServletRequest, String)
Use `ResourceResolver.map(HttpServletRequest, String)` instead.
org.apache.sling.api.resource.ResourceResolver.resolve(HttpServletRequest)
as of 2.0.4, use `ResourceResolver.resolve(HttpServletRequest, String)` instead.
org.apache.sling.api.resource.ResourceResolver.resolve(HttpServletRequest, String)
Use `ResourceResolver.resolve(HttpServletRequest, String)` instead.
org.apache.sling.api.resource.ResourceResolverFactory.getAdministrativeResourceResolver(Map<String, Object>)
as of 2.4 (bundle version 2.5.0) because of inherent security issues. Services requiring specific permissions should use the `ResourceResolverFactory.getServiceResourceResolver(Map)` instead.
org.apache.sling.api.resource.ResourceUtil.findResourceSuperType(Resource)
Use `ResourceResolver.getParentResourceType(Resource)`
org.apache.sling.api.resource.ResourceUtil.getName(Resource)
since 2.1.0, use `Resource.getName()` instead
org.apache.sling.api.resource.ResourceUtil.getParent(Resource)
since 2.1.0, use `Resource.getParent()` instead
org.apache.sling.api.resource.ResourceUtil.getResourceSuperType(ResourceResolver, String)
Use `ResourceResolver.getParentResourceType(String)`
org.apache.sling.api.resource.ResourceUtil.isA(Resource, String)
Use `ResourceResolver.isResourceType(Resource, String)`
org.apache.sling.api.resource.ResourceUtil.listChildren(Resource)
since 2.1.0, use `Resource.listChildren()` instead
org.apache.sling.api.scripting.SlingBindings.getRequest()
Use `SlingBindings.getJakartaRequest()` instead.
org.apache.sling.api.scripting.SlingBindings.getResponse()
Use `SlingBindings.getJakartaResponse()` instead.
org.apache.sling.api.scripting.SlingBindings.setRequest(SlingHttpServletRequest)
Use `SlingBindings.setJakartaRequest(SlingJakartaHttpServletRequest)` instead.
org.apache.sling.api.scripting.SlingBindings.setResponse(SlingHttpServletResponse)
Use `SlingBindings.setJakartaResponse(SlingJakartaHttpServletResponse)` instead.
org.apache.sling.api.scripting.SlingScriptHelper.dispose()
This method is deprecated since version 2.1 and will be removed. It should never be called by clients.
org.apache.sling.api.scripting.SlingScriptHelper.getRequest()
Use `SlingScriptHelper.getJakartaRequest()` instead.
org.apache.sling.api.scripting.SlingScriptHelper.getResponse()
Use `SlingScriptHelper.getJakartaResponse()` instead.
org.apache.sling.api.servlets.ServletResolver.resolveServlet(Resource, String)
Use `ServletResolver.resolve(Resource, String)` instead.
org.apache.sling.api.servlets.ServletResolver.resolveServlet(ResourceResolver, String)
Use `ServletResolver.resolve(ResourceResolver, String)` instead.
org.apache.sling.api.servlets.ServletResolver.resolveServlet(SlingHttpServletRequest)
Use `ServletResolver.resolve(SlingJakartaHttpServletRequest)` instead.
org.apache.sling.api.uri.SlingUriBuilder.createFrom(SlingHttpServletRequest)
Use `SlingUriBuilder.createFrom(SlingJakartaHttpServletRequest)` instead.
org.apache.sling.api.wrappers.ResourceResolverWrapper.map(HttpServletRequest, String)
org.apache.sling.api.wrappers.ResourceResolverWrapper.resolve(HttpServletRequest, String)
org.apache.sling.api.wrappers.SlingRequestPaths.getContextPath(HttpServletRequest)
Use `SlingRequestPaths.getContextPath(HttpServletRequest)`
org.apache.sling.api.wrappers.SlingRequestPaths.getPathInfo(HttpServletRequest)
Use `SlingRequestPaths.getPathInfo(HttpServletRequest)`
org.apache.sling.api.wrappers.SlingRequestPaths.getQueryString(HttpServletRequest)
Use `SlingRequestPaths.getQueryString(HttpServletRequest)`
org.apache.sling.api.wrappers.SlingRequestPaths.getRequestURI(HttpServletRequest)
Use `SlingRequestPaths.getRequestURI(HttpServletRequest)`
org.apache.sling.api.wrappers.SlingRequestPaths.getServletPath(HttpServletRequest)
Use `SlingRequestPaths.getServletPath(HttpServletRequest)`
org.apache.sling.api.wrappers.SlingRequestPaths.isIncluded(HttpServletRequest)
Use `SlingRequestPaths.isIncluded(HttpServletRequest)`

Deprecated Constructors
Constructor
Description
org.apache.sling.api.resource.observation.ResourceChange(ResourceChange.ChangeType, String, boolean, Set<String>, Set<String>, Set<String>)
The sets of property names are not supported anymore.
org.apache.sling.api.SlingServletException(ServletException)
Use `SlingServletException(ServletException)`