Adding Taglibraries to a web app [message #191332] |
Wed, 11 April 2007 13:42 |
Eclipse User |
|
|
|
Originally posted by: wknauf_NO_._INSIDE_hg-online.de
Hi everybody,
I have read several discussions here on how to add a taglib to a WTP webapp, and
I have heard many times that it is not required to add the TLD file to WEB-INF,
and that it is not required to add a <jsp-config>-element to web.xml.
Only required steps are:
a) add jar file to web-inf\lib
b) add this to the JSP page: <%@ taglib uri="http://java.sun.com/jstl/core"
prefix="c" %>
I found that this is not enough with the JSTL core library (1.2) and JBoss
4.2.0. This one looks for a tld with matching URI in the JAR file and finds
"c-1_0.tld", a really old 1.0 tld which does not allow EL attributes for e.g.
c:if tags.
This results in strange errors while running the app. WTP seems to be more smart
here and picks the proper tld ;-).
So, it does not harm to perform all 4 steps to include a taglib ;-).
I filed a JBoss bug report, let's see what will happen.
http://jira.jboss.org/jira/browse/JBAS-4315?page=all
Wolfgang
|
|
|
Re: Adding Taglibraries to a web app [message #191359 is a reply to message #191332] |
Wed, 11 April 2007 18:09 |
|
Wolfgang Knauf wrote:
> Hi everybody,
>
> I have read several discussions here on how to add a taglib to a WTP
> webapp, and I have heard many times that it is not required to add the
> TLD file to WEB-INF, and that it is not required to add a
> <jsp-config>-element to web.xml.
> Only required steps are:
> a) add jar file to web-inf\lib
> b) add this to the JSP page: <%@ taglib
> uri="http://java.sun.com/jstl/core" prefix="c" %>
>
> I found that this is not enough with the JSTL core library (1.2) and
> JBoss 4.2.0. This one looks for a tld with matching URI in the JAR file
> and finds "c-1_0.tld", a really old 1.0 tld which does not allow EL
> attributes for e.g. c:if tags.
> This results in strange errors while running the app. WTP seems to be
> more smart here and picks the proper tld ;-).
>
> So, it does not harm to perform all 4 steps to include a taglib ;-).
It sounds like you want to use the http://java.sun.com/jsp/jstl/core
URI instead to pick up the newer version.
--
Nitin Dahyabhai
Structured Source Editor
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
|
Re: Adding Taglibraries to a web app [message #720105 is a reply to message #719985] |
Mon, 29 August 2011 22:03 |
|
Aside from putting those taglib directives into a file declared as a matching jsp-prelude, no, at least there's no such mechanism yet (nor a clear RFE requesting a solution along those lines).
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.03093 seconds