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 8 Answers

  1. Given an HTML form that uses checkboxes to allow a user to select multiple values for a parameter called hobbies.

    (JSP v2.0 sections 2.2.3)

    Which EL expressions evaluate to the first value of the hobbies parameter? (Choose all that apply.)

    A.

    ${param.hobbies}

    B.

    ${paramValue.hobbies}

    C.

    ${paramValues.hobbies[0]}

    D.

    ${paramValues.hobbies[1]}

    E.

    ${paramValues[hobbies][0]}

    F.

    ${paramValues[hobbies][1]}

    Note

    -Option B is incorrect because there is no “paramValue” implicit variable.

    -Option D is incorrect, arrays are 0 indexed.

    -Options E and F have incorrect syntax.

  2. Given that a web application stores the webmaster email address in the servlet context initialization parameter called master-email.

    (JSP v2.0 sections 2.2.3 and 2.3.4)

    Which retrieves that value? (Choose all that apply.)

    A. ...

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