The <%@ taglib %> directive has to go in the JSP that calls out to the tag, so that it knows where to find it. Not in the tag itself (unless that tag itself uses other tags).
Simple JSP file cannot display simple custom tag
-
16-07-2023 - |
Frage
My project structure in eclipse -
Header.tag -
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags"%>
<html>
<head>
</head>
<body>
<img src="../images/java_logo.gif"><br>
</body>
</html>
MyTagUser.jsp -
<html>
<head>
</head>
<body>
<myTags:Header/>
Java is awesome !
</body>
</html>
Output is 'Java is awesome'. No image or image placeholder is displayed. What is my mistake ?
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow