• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

When can I use custom tag prefixes  RSS feed

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I just want to confirm 2 things on tag prefixes:

1. If I created my own tld and tag, I can do:
<%@ taglib prefix="mineOwnPrefix" uri="randomLocation"%>
<mineOwnPrefix:setMyText user="${userName}"/>

2. If I use the tld's provided by JSTL: Then I cannot use my own custom prefix like:
<%@ taglib prefix="mineOwnPrefix" uri="http://java.sun.com/jsp/jstl/core"%>
<mineOwnPrefix:forEach> ...

Am I right? I just got confused with when I can use my prefix and when I cannot.

Thanks so much,
Carmen
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always use your own custom prefixes. There is no restriction on that.
 
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can use the core library with another prefix than c. This is just a "convention". You can set the JSTL core library to whichPrefixShouldI then call tags with :

<whichPrefixShouldI:choose>
...

Sorry bad joke.

But the prefix is actually whatever you want.
 
pie sneak
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not following the conventions will make your coworkers very unhappy.
 
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Not following the conventions will make your coworkers very unhappy.



Which might affect your appraisal also
 
Carmen Brianick
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frederic, thanks for your reply. However, in the Chapter 9 Mock Exam for HFSJ book, wasn't there a question where only the choice with <c:set > was the answer and no other choice. I have to get the exact question and I'll post a question with that. Do you know which question I'm referring to?

BTW, thanks so much for your study guides, Many thanks!!!
Carmen
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!