 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Derek Clarkson Guest
|
Posted: Mon Apr 18, 2005 2:55 am Post subject: TAgLibs not installing in X, 2005 |
|
|
Hi all, had this problem is both X and 2005. Basically if I create a custom taglib, add it as a library, and then select it into the web module's web page, the tld files I have created are not added to the WEB-INF directory.
I am creating them with URIs like www.lonelyplanet.com.au/taglibs/accounts and adding the TLDs in the library frameworks page, but they simply refuse to appear in the WEB-INF of the web module even though the modules properties shows the taglib as being part of the project.
I've tried all sorts of things and the only thing that seems to work is if I change the URI to remove the URL from it. I can actually put just about anything in there as long as it is not a URL.
Can anyone explain this ? All the web searchs I have run suggest that I m doing the correct thing.
ciao
Derek.
|
|
| Back to top |
|
 |
Kevin Dean [TeamB] Guest
|
Posted: Mon Apr 18, 2005 8:36 pm Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Derek Clarkson wrote:
| Quote: |
Hi all, had this problem is both X and 2005. Basically if I create a
custom taglib, add it as a library, and then select it into the web
module's web page, the tld files I have created are not added to the
WEB-INF directory.
I am creating them with URIs like
www.lonelyplanet.com.au/taglibs/accounts and adding the TLDs in the
library frameworks page, but they simply refuse to appear in the
WEB-INF of the web module even though the modules properties shows
the taglib as being part of the project.
I've tried all sorts of things and the only thing that seems to work
is if I change the URI to remove the URL from it. I can actually put
just about anything in there as long as it is not a URL.
Can anyone explain this ? All the web searchs I have run suggest that
I m doing the correct thing.
|
You're doing the right thing. JBuilder doesn't put the taglib into the
WEB-INF directory if the taglib defines a URI. For example, if you
have:
<taglib>
...
<uri>http://www.mycompany.com/taglib/myTagLib</uri>
...
</taglib>
then you can import the taglib directly as follows:
<%@ taglib uri="http://www.mycompany.com/taglib/myTagLib" prefix="pfx"
%>
That way, you don't have to worry about version management of the
taglib.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Derek Clarkson Guest
|
Posted: Tue Apr 19, 2005 2:04 am Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Thanks Kevin,
I'm not sure exactly what you mean by this in the context I am using them. The taglibs are custom written by myself and part of
the war file I upload. I have done this so that each web site is
complete self contained because in the past we have had problems
with people uploading new code willy nilly and causing systems to
fail due to in-compatibilities.
Having said that, I have now found the problem. Basically when
I was setting up the framework tab in the library entry for the
taglib, I was selecting TLD files from within the jar. I cross
referenced what I was doing against the struts ones and realised that
they sourced their TLDs from outside the jars. I did this indicating
the TLDs in my source directories and now JBuilder automatically
includes the TLDs in the WEB-INF directory whenever I select
them in the web module.
ciao
Derek
|
|
| Back to top |
|
 |
Kevin Dean [TeamB] Guest
|
Posted: Tue Apr 19, 2005 1:28 pm Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Derek Clarkson wrote:
| Quote: | I'm not sure exactly what you mean by this in the context I am using
them. The taglibs are custom written by myself and part of the war
file I upload. I have done this so that each web site is complete
self contained because in the past we have had problems with people
uploading new code willy nilly and causing systems to fail due to
in-compatibilities.
Having said that, I have now found the problem. Basically when
I was setting up the framework tab in the library entry for the
taglib, I was selecting TLD files from within the jar. I cross
referenced what I was doing against the struts ones and realised that
they sourced their TLDs from outside the jars. I did this indicating
the TLDs in my source directories and now JBuilder automatically
includes the TLDs in the WEB-INF directory whenever I select
them in the web module.
|
My point is that the TLD files don't need to be in the WEB-INF
directory at all. If the URI is defined in the TLD, you can reference
the TLD via the URI and web container will automatically find it in the
appropriate JAR file. It makes TLD file management much easier.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Derek Clarkson Guest
|
Posted: Fri Apr 22, 2005 2:19 am Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
"Kevin Dean [TeamB]" <NkOdSePaAnM (AT) datadevelopment (DOT) com> wrote:
| Quote: | My point is that the TLD files don't need to be in the WEB-INF
directory at all. If the URI is defined in the TLD, you can >reference the TLD via the URI and web container will automatically >find it in the appropriate JAR file. It makes TLD file management >much easier.
|
Sorry Kevin, I'm not following you. Can you give an example ? How do I reference a TLD in a web page so that it is found within the jar file in the lib directory. At the moment my TLDs use URI like
http://www.lonelyplanet.com.au/taglibs/accounts
so that they are unique. These URIs do not actually exist, but JBuilder automatically adds the TLD to the WEB-INF so that it's editors and JSP can see it. The TLD though, cannot be the one stored in the WEB-INF/tlds directory in my jar file. Instead when setting up the library and adding the tlds to the frameworks tab, I have to go and select the original TLDs use to build the jar. JBuilder then copies these into the WEB-INF when I select the framework in the web module setup.
Is this making sense ? ;-)
ciao
Derek.
|
|
| Back to top |
|
 |
Kevin Dean [TeamB] Guest
|
Posted: Fri Apr 22, 2005 5:07 pm Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Derek Clarkson wrote:
| Quote: | Sorry Kevin, I'm not following you. Can you give an example ? How do
I reference a TLD in a web page so that it is found within the jar
file in the lib directory. At the moment my TLDs use URI like
http://www.lonelyplanet.com.au/taglibs/accounts
so that they are unique. These URIs do not actually exist, but
JBuilder automatically adds the TLD to the WEB-INF so that it's
editors and JSP can see it. The TLD though, cannot be the one stored
in the WEB-INF/tlds directory in my jar file. Instead when setting up
the library and adding the tlds to the frameworks tab, I have to go
and select the original TLDs use to build the jar. JBuilder then
copies these into the WEB-INF when I select the framework in the web
module setup.
Is this making sense ?
|
OK, got it. Now I understand the problem.
In addition to specifying the URI, you have to store the the TLD in the
JAR file as META-INF/taglib.tld (that's a JSP spec requirement).
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Derek Clarkson Guest
|
Posted: Tue Apr 26, 2005 6:16 am Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Thanks Kevin, but I could not get it to work. I tried moving the
tlds from META-INF/tlds/*.tld to META-INF/*.tld within the jar,
then reconfigured the library setting to reference the TLDs in the
jar instead of the original source ones.
JBuilder would still fail to add then to the WEB-INF directory and
validate the JSPs when I selected the library in the web settings
of the web module. The only time I got close was if I actually
named the tld file taglib.tld instead of the names I had assigned.
Then JBuilder would add the taglib reference to the web.xml
but still fail to add the tld to the WEB-INF so the JSPs still
failed to validate.
I also looked up the JSP 1.2 spec and could not see anything
regarding TLDs.
Finally the other thing I find annoying is that in order to
build a jar with the META-INF/*.tld files I had to go into the
jar content settings and manually add each tld file in. No
combination of filters or project include settings I tried would
automatically include tld files.
ciao
Derek.
|
|
| Back to top |
|
 |
Kevin Dean [TeamB] Guest
|
Posted: Tue Apr 26, 2005 12:17 pm Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Derek Clarkson wrote:
| Quote: |
Thanks Kevin, but I could not get it to work. I tried moving the
tlds from META-INF/tlds/*.tld to META-INF/*.tld within the jar,
then reconfigured the library setting to reference the TLDs in the
jar instead of the original source ones.
JBuilder would still fail to add then to the WEB-INF directory and
validate the JSPs when I selected the library in the web settings
of the web module. The only time I got close was if I actually
named the tld file taglib.tld instead of the names I had assigned.
Then JBuilder would add the taglib reference to the web.xml
but still fail to add the tld to the WEB-INF so the JSPs still
failed to validate.
I also looked up the JSP 1.2 spec and could not see anything
regarding TLDs.
Finally the other thing I find annoying is that in order to
build a jar with the META-INF/*.tld files I had to go into the
jar content settings and manually add each tld file in. No
combination of filters or project include settings I tried would
automatically include tld files.
|
The file has to be called taglib.tld and has to exist in the META-INF
directory. You're right about having to add it manually; the only way
I can get it to work is to put it into src/META-INF and add it to the
JAR file contents using the "Add Files..." button in the "Content" pane.
JBuilder shouldn't be adding the taglib.tld file to the "Tag Libraries"
section of web.xml for URI-based taglibs; I vaguely recall having to
delete those entries to get things to work.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Derek Clarkson Guest
|
Posted: Wed Apr 27, 2005 1:30 am Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Thats definitely confusing. When I look at the setup of the struts 1.2 that came with JB2005, it's referencing tlds that exist in the jar under a variety of names and are also are stored in the META-INF/tlds/*.tld file structure. So I don't know how JB is correctly adding them to the WEB-INF directory and not adding mine which I basically did as a copy of this struture. Plus they agree with the spec as you outlined so JB should not recognise them, but does. The only difference I can see between the jar containing struts 1.2 and my jars is that it has a lot more manifest entries. But I cannot see how they related to this issue. I cannot see any other files in the jar that appear to hold informating that JB may be using.
Very confused ... wish a JB Coder would jump in here and make sense of all this ! ;-)
ciao
Derek
| Quote: | The file has to be called taglib.tld and has to exist in the META-INF
directory. You're right about having to add it manually; the only way
I can get it to work is to put it into src/META-INF and add it to the
JAR file contents using the "Add Files..." button in the "Content" pane.
JBuilder shouldn't be adding the taglib.tld file to the "Tag Libraries"
section of web.xml for URI-based taglibs; I vaguely recall having to
delete those entries to get things to work.
|
|
|
| Back to top |
|
 |
Derek Clarkson Guest
|
Posted: Wed Apr 27, 2005 1:38 am Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
just a thought, I am not storing jars of taglibs in the server directories and am storing them in the WEB-INF/lib directory in the war files. I'm doing this to ensure correct versions etc. Could this method have something to do with this issue ? Should I be storing jars in the server's tomcat directories and not putting them in the wars ?
ciao
Derek
|
|
| Back to top |
|
 |
Kevin Dean [TeamB] Guest
|
Posted: Wed Apr 27, 2005 2:12 am Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Derek Clarkson wrote:
| Quote: |
just a thought, I am not storing jars of taglibs in the server
directories and am storing them in the WEB-INF/lib directory in the
war files. I'm doing this to ensure correct versions etc. Could this
method have something to do with this issue ? Should I be storing
jars in the server's tomcat directories and not putting them in the
wars ?
|
The Struts stuff doesn't use the URI mapping and JBuilder appears to
have been written to handle the way Struts handles its TLDs.
Yes, you should include your taglib libraries in WEB-INF/lib (at least,
I do and it works fine).
It would appear I made a mistake in my previous postings. The file
doesn't have to be called taglib.tld; it can be called whatever you
want (with a .tld extension) but it must be stored in META-INF. As
long as the URI in the TLD matches the URI in taglib declaration in the
JSP, it should work.
At this point I'm at a loss to explain your problem. If you can
whittle it down to a sample and upload it to
borland.public.attachments, I can take a closer look.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Lata Amujuri Guest
|
Posted: Wed Apr 27, 2005 4:59 pm Post subject: Re: TAgLibs not installing in X, 2005 |
|
|
Derek,
Check this article out for an explanation on how taglib definitions work
with JSP 1.2.
http://www.oreillynet.com/pub/wlg/5105
You can also look at the configuration of the InternetBeans Express library
in JBuilder which is a custom tag library from Borland that ships with
Jbuilder. The tld is included in the JAR in this case.
Thanks.
- Lata
"Derek Clarkson" <derek.clarkson (AT) lonelyplanet (DOT) com.au> wrote
| Quote: |
just a thought, I am not storing jars of taglibs in the server directories
and am storing them in the WEB-INF/lib directory in the war files. I'm
doing this to ensure correct versions etc. Could this method have
something to do with this issue ? Should I be storing jars in the server's
tomcat directories and not putting them in the wars ?
ciao
Derek
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|