Web tier: servlets, JSP, Web frameworks: JSTL/EL Syntax Question

  1. JSTL/EL Syntax Question (1 messages)


    I've started to use JSTL in my JSPs and have encountered a syntax issue. I want to check an object in the request scope but am having problems figuring out how to retrieve it. For example, say I just put a String object into the request scope under the key "hello":
    request.setAttribute( "hello", "Hello World" );

    and in my JSP I want to print it out, so I would do this:
    <c:out value="${hello}"/>

    But how would I do the same thing if my key is a String containing dots such as this:
    request.setAttribute( "hello.world.display.string", "Hello World" );

    I know this does NOT work:
    <c:out value="${hello.world.display.string}"/>

    The problem here is that the above statement is looking for the object hello, then it looks for the getter getWorld, and so forth. How do I go about retrieving the "hello.world.display.string" from the request scope?



    Threaded Messages (1)

  2. JSTL/EL Syntax Question[ Go to top ]


    <c:out value='${requestScope[\"hello.world.display.string\"]}'/>