Top Deprecated
Java Servlet API 4.0.1

Deprecated API


No API in this release is deprecated for removal.

Deprecated Item Summary

SinceDeprecated Item and Description

Returns:

the javax.servlet.Servlet Servlet with the given name
javax.servlet.ServletContext.getServlet
(String
the servlet name
name
)

As of Java Servlet API 2.1, with no direct replacement.

This method was originally defined to retrieve a servlet from a ServletContext. In this version, this method always returns null and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

In lieu of this method, servlets can share information using the ServletContext class and can perform shared business logic by invoking methods on common non-servlet classes.

Returns:

an Enumeration of javax.servlet.Servlet Servlet names
javax.servlet.ServletContext.getServletNames
()

As of Java Servlet API 2.1, with no replacement.

This method was originally defined to return an Enumeration of all the servlet names known to this context. In this version, this method always returns an empty Enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

Returns:

an Enumeration of javax.servlet.Servlet Servlet
javax.servlet.ServletContext.getServlets
()

As of Java Servlet API 2.0, with no replacement.

This method was originally defined to return an Enumeration of all the servlets known to this servlet context. In this version, this method always returns an empty enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

javax.servlet.ServletContext.log(Exception
the Exception error
exception
,
String
a String that describes the exception
msg
)

As of Java Servlet API 2.1, use log(String message, Throwable throwable) instead.

This method was originally defined to write an exception's stack trace and an explanatory error message to the servlet log file.

Returns:

the real path, or null if the translation cannot be performed.
javax.servlet.ServletRequest.getRealPath
(String
the path for which the real path is to be returned.
path
)

As of Version 2.1 of the Java Servlet API, use ServletContext#getRealPath instead.

javax.servlet.ServletRequestWrapper.getRealPath(String
the path for which the real path is to be returned.
path
)

As of Version 2.1 of the Java Servlet API, use ServletContext#getRealPath instead

javax.servlet.SingleThreadModel

As of Java Servlet API 2.4, with no direct replacement.

javax.servlet.UnavailableException.UnavailableException(Servlet
the Servlet instance that is unavailable
servlet
,
String
a String specifying the descriptive message
msg
)

As of Java Servlet API 2.2, use UnavailableException(String) instead.

javax.servlet.UnavailableException.UnavailableException(int
an integer specifying the number of seconds the servlet expects to be unavailable; if zero or negative, indicates that the servlet can't make an estimate
seconds
,
Servlet
the Servlet that is unavailable
servlet
,
String
a String specifying the descriptive message, which can be written to a log file or displayed for the user.
msg
)

As of Java Servlet API 2.2, use UnavailableException(String, int) instead.

Returns:

the Servlet object that is throwing the UnavailableException
javax.servlet.UnavailableException.getServlet
()

As of Java Servlet API 2.2, with no replacement. Returns the servlet that is reporting its unavailability.

Returns:

true if the session ID was conveyed to the server as part of a URL; otherwise, false
javax.servlet.http.HttpServletRequest.isRequestedSessionIdFromUrl
()

As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL instead.

Returns:

the encoded URL if encoding is needed; the unchanged URL otherwise.
javax.servlet.http.HttpServletResponse.encodeRedirectUrl
(String
the url to be encoded.
url
)

As of version 2.1, use encodeRedirectURL(String url) instead

Returns:

the encoded URL if encoding is needed; the unchanged URL otherwise.
javax.servlet.http.HttpServletResponse.encodeUrl
(String
the url to be encoded.
url
)

As of version 2.1, use encodeURL(String url) instead

javax.servlet.http.HttpServletResponse.setStatus(int
the status code
sc
,
String
the status message
sm
)

As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use setStatus(int), to send an error with a description use sendError(int, String). Sets the status code and message for this response.

javax.servlet.http.HttpServletResponseWrapper.encodeUrl(String
the url to be encoded.
url
)

As of version 2.1, use encodeURL(String url) instead

javax.servlet.http.HttpServletResponseWrapper.setStatus(int
the status code
sc
,
String
the status message
sm
)

As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use setStatus(int), to send an error with a description use sendError(int, String)

Returns:

the HttpSessionContext for this session.
javax.servlet.http.HttpSession.getSessionContext
()

As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API.

Returns:

the object with the specified name
javax.servlet.http.HttpSession.getValue
(String
a string specifying the name of the object
name
)

As of Version 2.2, this method is replaced by getAttribute.

Returns:

an array of String objects specifying the names of all the objects bound to this session
javax.servlet.http.HttpSession.getValueNames
()

As of Version 2.2, this method is replaced by getAttributeNames

javax.servlet.http.HttpSession.putValue(String
the name to which the object is bound; cannot be null
name
,
Object
the object to be bound; cannot be null
value
)

As of Version 2.2, this method is replaced by setAttribute

javax.servlet.http.HttpSession.removeValue(String
the name of the object to remove from this session
name
)

As of Version 2.2, this method is replaced by removeAttribute

javax.servlet.http.HttpSessionContext

As of Java(tm) Servlet API 2.1 for security reasons, with no replacement. This interface will be removed in a future version of this API.

Returns:

null
javax.servlet.http.HttpSessionContext.getIds
()

As of Java Servlet API 2.1 with no replacement. This method must return an empty Enumeration and will be removed in a future version of this API.

Returns:

null in all cases
javax.servlet.http.HttpSessionContext.getSession
(String
the id of the session to be returned
sessionId
)

As of Java Servlet API 2.1 with no replacement. This method must return null and will be removed in a future version of this API.

javax.servlet.http.HttpUtils

As of Java(tm) Servlet API 2.3. These methods were only useful with the default encoding and have been moved to the request interfaces.