File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When can I use custom tag prefixes

 
Carmen Brianick
Ranch Hand
Posts: 67
  • 0
  • 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
 
Satish Ramasamy
Greenhorn
Posts: 15
  • 0
  • 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.
 
Frederic Esnault
Ranch Hand
Posts: 284
  • 0
  • 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.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not following the conventions will make your coworkers very unhappy.
 
Vishwas Hegde
Ranch Hand
Posts: 212
  • 0
  • 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
  • 0
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic