Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Miscellaneous doubts

 
Harshit Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. in c:forEach tag, can "begin" attribute be greater than "end" attribute, and "step" be -ve, so that the loop can count backwards?

2. when we use "tagdir" attribute in the taglib directive, it just points to the directory where the tag file is kept; however, how does the container know which tag file in the directory to select, since there might be more than 1 tag file in the directory?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. If end is specified and it is less than begin, the loop is simply not executed. step must be >= 1
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2. When using the "tagdir" attribute, every tag will be read, and the filename will become the name of the tag.
For example : two files : mytag.tag, hello.tag

<%@ taglib tagdir="/WEB-INF/tags" prefix="tag" %>

<tag:mytag/>
<tag:hello/>
[ March 06, 2007: Message edited by: Satou kurinosuke ]
 
Rishi Chopra
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. For the answer to your first question if "begin" is greater than "end" then the loop is simply not executed.NO ERROR

"step" must be greater than or equal to 1 else ERROR

2. The Tag File is choosen by the name of tag you use.
for e.g

if you have a Tag File Named NavBar.tag and Header.tag in WEB-INF/tags folder then
in jsp when you define

<%@ taglib tagdir="/WEB-INF/tags" prefix="mine" %>

<mine:Header> ----> this will invoke your Header.tag file
<mine:NavBar> ----> this will invoke your NavBar.tag file

Also remember you can name your tag file with extension as either .tag or .tagx

Hope i cleared all your doubts

Regards
Rishi Chopra
 
Harshit Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more: in a JSP, can we change the references for the implicit objects, or are they marked as final? e.g. can we do this:

out = null;
[ March 06, 2007: Message edited by: H Pathak ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic