• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to have mulitple taglib declarations

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic