Usunięto nieaktualne klasy i metody serwletu Jakarta

W serwlecie Jakarta 6.0 usunięto nieaktualne metody i klasy serwletu Jakarta. Usuń użycie tych klas i metod ze swojej aplikacji.

Usunięte klasy serwletów Jakarta:

Usunięte klasy serwletów Jakarta

Zastępujące klasy serwletów Jakarta

jakarta.servlet.http.HttpSessionContext

Brak. Klasa jakarta.servlet.http.HttpSessionContext została usunięta ze względów bezpieczeństwa bez zapewnienia klasy zastępczej.

jakarta.servlet.http.HttpUtils

Ta klasa jest nieaktualna. Metody w interfejsach żądań udostępniają podobną funkcjonalność. HttpServletRequest.getRequestURL() może zastąpić HttpUtils.getRequestURL(HttpServletRequest) i HttpServletRequest.getParameterMap() może zastąpić HttpUtils.parsePostData(int, ServletInputStream)​ lub HttpUtils.parseQueryString(String)​.

jakarta.servlet.SingleThreadModel

Brak

Usunięte metody serwletu Jakarta:

Usunięte metody serwletu Jakarta

Zastępujące metody serwletu Jakarta

jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdFromUrl() i jakarta.servlet.http.HttpServletRequestWrapper.isRequestedSessionIdFromUrl()

HttpServletRequest.isRequestedSessionIdFromURL() i HttpServletRequestWrapper.isRequestedSessionIdFromURL()

jakarta.servlet.http.HttpServletResponse.encodeUrl(String) i jakarta.servlet.http.HttpServletResponseWrapper.encodeUrl(String)

HttpServletResponse.encodeURL(String) i HttpServletResponseWrapper.encodeURL(String)

jakarta.servlet.http.HttpServletResponse.encodeRedirectUrl(String) i jakarta.servlet.http.HttpServletResponseWrapper.encodeRedirectUrl(String)

HttpServletResponse.encodeRedirectURL(String) i HttpServletResponseWrapper.encodeRedirectURL(String)

jakarta.servlet.http.HttpServletResponse.setStatus(int, String) i jakarta.servlet.http.HttpServletResponseWrapper.setStatus(int, String)

Aby ustawić kod statusu, należy użyć setStatus(int). Aby wysłać błąd z opisem, należy użyć sendError(int, String).

jakarta.servlet.http.HttpSession.getSessionContext()

Brak

jakarta.servlet.http.HttpSession.getValue(String)

HttpSession.getAttribute(String)

jakarta.servlet.http.HttpSession.getValueNames()

HttpSession.getAttributeNames()

jakarta.servlet.http.HttpSession.putValue(String, Object)

HttpSession.setAttribute(String, Object)

jakarta.servlet.http.HttpSession.removeValue(String)

HttpSession.removeAttribute(String)

jakarta.servlet.ServletContext.getServlet(String)

Brak. Poprzednio ta metoda zawsze zwracała wartość NULL.

jakarta.servlet.ServletContext.getServlets()

Brak. Poprzednio ta metoda zawsze zwracała puste wyliczenie.

jakarta.servlet.ServletContext.getServletNames()

Brak. Poprzednio ta metoda zawsze zwracała puste wyliczenie.

jakarta.servlet.ServletContext.log(Exception, String)

ServletContext.log(String, Throwable)

jakarta.servlet.ServletRequest.getRealPath(String) i jakarta.servlet.ServletRequestWrapper.getRealPath(String)

ServletContext.getRealPath(String)

jakarta.servlet.UnavailableException.getServlet()

Brak

Usunięte konstruktory serwletu Jakarta:

Usunięte konstruktory serwletu Jakarta

Zastępcze konstruktory serwletu Jakarta

jakarta.servlet.UnavailableException(int, jakarta.servlet.Servlet, String)

UnavailableException(String, int)

jakarta.servlet.UnavailableException(jakarta.servlet.Servlet, String)

UnavailableException(String)

Ta reguła zawiera automatyczną poprawkę, która umożliwia zastąpienie nieaktualnych klas i metod serwletu Jakarta przez odpowiadające im metody zastępcze. Skopiuj konfigurację niestandardową do pliku budowania aplikacji, aby włączyć automatyzację poprawek.

Więcej informacji na temat migracji Jakarta 10 znajduje się w sekcji Różnice między serwletami Jakarta 6.0 i 5.0.

Więcej informacji na ten temat zawierają uwagi dotyczące dezaktualizacji w dokumentacji Javadoc serwletu 5.0.