spring and apache tiles with shared taglib
Asked Answered
C

1

2

I´m creating spring and apache tiles baserd application. I want to share a taglib in my parts of layout. I`ve added in my layout

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Now I want to create a foreach loop in the parts of layout but I can`t. When I added this taglib definition in the part of layout it worked. Can I add the taglib only n one place or I need to add it in every jsp file ?

Cleora answered 31/12, 2011 at 11:34 Comment(0)
T
5

You need to add the taglib for each jsp file.

Because tiles works after the jsp files are compiled, and the taglib definition is needed for compiling (the compiler does not know anything about tiles).

Terza answered 31/12, 2011 at 11:54 Comment(3)
that is sad :( I`ve started using apache tiles cause i thought that I can add every shared component in one place not in all every jsp file. But thank you for helpCleora
Fixus: An solution that may help is to use c:include to include a file that contains all the definitions.Terza
but where I use this include ? won`t it force to download more data by while view rendering ?Cleora

© 2022 - 2024 — McMap. All rights reserved.