Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jsp tags outside WEB-INF/tags

Tags:

java

jsp

jsp-tags

Is there any way to hold tag files out of /WEB-INF/tags folder? Maybe by using tld somehow and calling them with uri instead of tagdir?

Reason for this request is that we are trying to run several sites from one codebase and we would like to have it like WEB-INF/site1/templates, tags, ... so if this is wrong idea to begin with, feel free to say so.

like image 256
Slartibartfast Avatar asked Sep 30 '09 17:09

Slartibartfast


2 Answers

Apparently not: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags6.html even if using tld to say where the tag is, it can be either in WEB-INF/tags or META-INF/tags for tags packed in jars.

like image 137
Slartibartfast Avatar answered Sep 30 '22 10:09

Slartibartfast


The standard way to deliver taglib is to pack all your tags in a jar and have the TLDs in the jar also in this directory,

  META-INF/tld/

When container starts up, it will scan all the jars for TLD so it knows where to find the tags. You simply use URL to refer to the tags. That's how JSTL works.

like image 35
ZZ Coder Avatar answered Sep 30 '22 11:09

ZZ Coder