• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Miscellaneous doubts

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic