This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to have mulitple taglib declarations  RSS feed

 
Charles Hasegawa
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Running one of my pages in Tomcat, I got the following error :

I believe it is because my main page declares:

but so does a page fragment that is included via :

Is there any way in the fragment, to check and see if the @ taglib prefix is already in use and thus ignore the directive?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way in the fragment, to check and see if the @ taglib prefix is already in use and thus ignore the directive?

Oh geez, I don't think so. At least not that I am aware of.
In my own apps, I either use jsp:include, where it has its own page context and so this isn't a problem, or allow a JSP 'fragment' -- since it is essentially a '#include' into a parent page -- to assume that the parent page has performed any necessary setup.
Wouldn't it be nice if it were smart enough to see that the declarations were the same and not complain unless there were conflicts?
bear
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!