jsp-tags


Invalid tagdir attribute while web-fragment is used


I am using web-fragment feature to maintain my JSPs and tags in a jar, and using this approach, my JSP pages are unable to find the tagdir, and cause "The value of the tagdir attribute for this tag library is invalid."
Here is the structure in my jar.
META-INF
-- resources
-- WEB-INF
-- tags
-- mytag.tag
-- mypage.jsp
-- web-fragment.xml
In mypage.jsp, I specify the taglib as following:
And I got these errors:
mypage.jsp:7:4: The taglib directive must specify either the "uri" or "tagdir" attribute.
mypage.jsp:7:33: The value of the tagdir attribute for this tag library is invalid.
It seems like under this approach, it cannot find the tagdir. I tried the same structure in my war with web.xml, and it was able to find the tags. So I wonder if there is any way I can use the similar solution with web-fragment approach.
You don't need WEB-INF in the web-fragment project. Use this structure instead:
web-fragment project:
META-INF/
-- resources/
-- tags/
-- mytag.tag
-- mypage.jsp
-- web-fragment.xml
Everything inside the resources directory will now be available to referencing projects as if they were deployed inside WEB-INF.
web project:
WEB-INF/
-- tags/
-- othertag.tag
-- (mytag.tag)
-- otherpage.jsp
-- (mypage.jsp)
So to reference mytag.tag from the web project:
<%# taglib prefix="my" tagdir="/WEB-INF/tags" %>
...
<my:mytag ... />
As for the errors you are seeing, I don't know what you tried, but here's how you'd do it:
for a .tag you must specify tagdir and set it to the tag's folder:
<%# taglib prefix="my" tagdir="/WEB-INF/tags" %>
for a .tld you must specify uri and set it to the tld's URI:
<%# taglib prefix="mytld" uri="http://example.com/tld/my" %>

Related Links

jsp code to upload jgp files and save in mysql db
when I run my jsp pgogram I got this exception error type Exception report
jstl formatNumber in input leads to NumberFormatException
Youtube onYouTubePlayerReady() function not firing
username and password cannot be resolved or is not a field
How page directive “extend” in jsp works?
Simple property not found?
Reusing JSP custom tags inside html
JSP Quiz process is not giving me the correct percentage scored
Refer the id variable of logic - iterate using jstl-el
Invalid tagdir attribute while web-fragment is used
JSP foreach tag for two variables
Adding Parameter to href tag before uri
Servlet exception stream closed jsp
creating and exporting a csv from Display tag table
bean write to number type id

Categories

HOME
ms-access
dictionary
mfc
homebrew
react-virtualized
hashmap
syntax
bookshelf.js
youtube-api-v3
jpeg
webpack-2
pivotal-cloud-foundry
ios-charts
directx
node-notifier
iggrid
metatrader4
adobe-analytics
node-pdfkit
here-api
spring-xd
quickbooks
hex-editors
decimal
progressive-web-apps
finite-automata
flux
textfield
swiftlint
autocad-plugin
kryo
graphicsmagick
csrf-protection
css-animations
excel-2007
pass-by-reference
crystal-reports-2010
sqlcipher
spark-jobserver
selectedindexchanged
intel-pin
traffic
windows-error-reporting
maquette
neo4j-spatial
jspm
unboundid
titanium-mobile
pdb
xmlreader
git-merge
serve
xcode-extension
automake
espeak
objectlistview
code-search-engine
jna
dynamic-reports
android-mediaprojection
modelmapper
wso2carbon
user-accounts
outlook-2013
parentheses
youcompleteme
strptime
zip4j
zendesk-app
or-tools
yt-project
radtreelist
home-directory
thrust
disque
pagedlist
moveit
ubuntu-10.04
testng-dataprovider
dlna
nessus
goose
photobucket
netmq
t4mvc
qdialog
rgeo
myo
dereference
apache-commons-net
facebook-graph-api-v2.4
camanjs
network-interface
javafx-webengine
php-5.4
navigationservice
funcunit
p4java
jquery-layout
datagridviewcolumn
oracle-warehouse-builder
comaddin
enterprisedb
drools-planner
jelly
pvrtc
dmoz
hamiltonian-cycle
gil
quickdialog
manchester-syntax
onsubmit
dotnethighcharts
hgsubversion
whoosh
blackberry-playbook
xmlspy
cinema-4d
appendto
locate
html-input
mirah
compiler-specific
photoshop-cs4
virtual-functions
eqatec
port-number
uiq3

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App