spring and apache tiles with shared taglib

随声附和 提交于 2019-12-11 01:38:05

问题


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 ?


回答1:


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).



来源:https://stackoverflow.com/questions/8687873/spring-and-apache-tiles-with-shared-taglib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!