0

I want put "title" attribute from JSP to template and replace default value.

Template:

<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<!doctype html>
    <head>
        <meta charset="utf-8">
        <title><tiles:getAsString name="title" /></title>
    </head>
    <body>
        ...
    </body>
</html>

Definition:

<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
    <definition name="*/*" template="/WEB-INF/tiles/layout.jsp">
        <put-attribute name="title" value="default value" />
        ...
    </definition>
</tiles-definitions>

JSP:

<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<tiles:putAttribute name="title" value="Login" />
...

And my title are still "default value" - why?

j0k
  • 22,600
  • 28
  • 79
  • 90
ntdrt
  • 1

1 Answers1

0

I'm presuming that the "template" refers to "/WEB-INF/tiles/layout.jsp"

But what is the filename of "JSP", and where is it included?

mck
  • 1,152
  • 10
  • 10