O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Coffee Cram: Chapter 5 Answers

  1. When using a RequestDispatcher, the use of which methods can often lead to an IllegalStateException? (Choose all that apply.)

    (Servlet v2.4 pg. 167)

    A.

    read

    B.

    flush

    C.

    write

    D.

    getOutputStream

    E.

    getResourceAsStream

    Note

    -An IllegalStateException is caused when a response has already been ‘committed’ to the client (the flush method does that), and then you attempt a forward.

  2. Which statements about ServletContext initialization parameters are true? (Choose all that apply.)

    (Servlet v2.4 pg. 31)

    A.

    They should be used for data that changes rarely.

    B.

    They should be used for data that changes frequently.

    C.

    They can be accessed using

    ServletContext.getParameter(String).

    D.

    They can be accessed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required