java


JSP tags in a Freemarker template


I want to use some custom tags in a freemarker template which is easy enough as I can include the JspSupportServlet in my web.xml file and include the folowing line in the template.
<#assign my=JspTaglibs["/WEB-INF/mytaglib.tld"] />
However how do I go about doing this if the .tld is bundled in a JAR file inside the META-INF directory? I tried both of these with no luck.
<#assign my=JspTaglibs["/META-INF/mytaglib.tld"] />
<#assign my=JspTaglibs["/mynamespace"] />
FreeMarker automatically scans all JAR files in your WEB-INF/lib directory. If it finds .tld files inside a JAR's META-INF directory, like your META-INF/mytaglib.tld, it will peek inside it in order to find the <uri> tag. If it finds one, it will make the taglib available via this URI, e.g a taglib defined like
<taglib>
<shortname>my custom taglib</shortname>
<uri>http://example.org/mytaglib</uri>
<!-- ... -->
</taglib>
can be used in FreeMarker via
<#assign my=JspTaglibs["http://example.org/mytaglib"] />
At least this worked for me...

Related Links

JAXB how to generate one single file for common elements
Incorrectly overriding the equals method for hashSets in Java
Stuff trying to create a user signin in hibernate/spring
Java audio keeps crackling in custom-made Sound class
Placing a JPanel on a new line using GridBagLayout
Minecraft forge doesn't load item texture 1.10.2
Does ResponseBuilder work with GET request but not POST?
Why does `List` not have a `map` default method when it has `forEach`?
How to ignore 'java.io.serialization' logger in java
javax.net.ssl.SSLHandshakeException: null cert chain
Parse CSV with quoted multiline string
Is it possible to implement comparator in single class?
How to split a body of text at an empty line in java?
spring-boot secutiry - invoked method after authorizating user
How to correctly put a dialog inside animation timer in JavaFX
In GLSL Shader, how to move an image 'smoothly' without 'scrubbing'

Categories

HOME
google-play
include
stock
grep
microservices
sharepoint-designer
c#-2.0
facebook-messenger-bot
gitpitch
kibana-4
ssl-client-authentication
vb.net-2010
dosgi
windows-7-x64
apache-metamodel
propel
shared-hosting
paging
physics-engine
kvc
kudan
trading
angular2-aot
url-scheme
react-css-modules
primitive
sql-server-2012-express
phonegap
winrt-xaml-toolkit
bitbucket-pipelines
libraries
firebase-admin
.net-4.6.2
businessworks
boost-multi-index
statsd
cudafy.net
gcsfuse
bind9
sts-springsourcetoolsuite
etsy
master-slave
bluemix-app-scan
wso2cloud
cartesian-product
cyclomatic-complexity
mutation-observers
embedded-code
deis
ideamart
interrupted-exception
clicktag
cdt
fpml
nsbutton
code-access-security
eol
jubula
hyprlinkr
resty-gwt
algebraic-data-types
oam
jsctypes
inbox
ora-00911
referrer
e4x
propertyeditor
regsvr32
netbeans-6.9
code-cleanup
gwt-ext
gallio
gamma
mozilla-prism
meego
audio-capture
microsoft-virtualization
phonon
dbisam
ntvdm.exe

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App