TheUnnamed454
TheUnnamed454

Reputation: 15

JSP - Value from tag attribute

I've got a problem with getting the value in <jsp:body> of ttt attribute. The following code does not work. I have spend too long on this, so I'm asking here. Can someone show me the proper way?

code fragment:

<jsp:element name="h3">
    <jsp:attribute name="ttt">
        ${param.txt}
    </jsp:attribute>
    <jsp:body>
        ${ttt} <-- this displays nothing
    </jsp:body>
</jsp:element>

Upvotes: 0

Views: 359

Answers (1)

Dino Tw
Dino Tw

Reputation: 3321

You want to set the variable in jsp by using <c:set> tag. A quick tutorial for your reference, http://www.tutorialspoint.com/jsp/jstl_core_set_tag.htm.

Upvotes: 1

Related Questions