Lernkarten

Karten 62 Karten
Lernende 1 Lernende
Sprache English
Stufe Andere
Erstellt / Aktualisiert 12.09.2017 / 04.10.2017
Lizenzierung Keine Angabe     (Fabrizi)
Weblink
Einbinden
0 Exakte Antworten 62 Text Antworten 0 Multiple Choice Antworten
Fenster schliessen

What's the use of request.getInputStream() and getReader()?

Retrieve large (binary...) content from the body of a POST-request.

Fenster schliessen

What's the difference between getRemotePort, getServerPort and getLocalPort
from the ServletRequest Interface?

getRemotePort: Obtain the port number of the client from which the request was sent.
getServerPort: Obtain the port number to which the request was originally SENT.
getLocalPort: Obtain the port number on which the request did actually END UP.

Fenster schliessen

How can a file "myFile.jar", at the root of the web app, 
be retrieved into an InputStream from a Servlet?

InputStream is = getServletContext().getResourceAsStream(“/myFile.jar”);

Fenster schliessen

Is this valid?

sendRedirect(new URL(“http://www.google.com”));

nope.

(Takes only a String!)

Fenster schliessen

What's the use of the setContentType() method of the ServletResponse Interface?

It tells the browser how to handle the data coming in with the response.

Fenster schliessen

When will sendRedirect() throw an IllegalStateException?

When the response is already committed.