• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock exam jstl core iteration custom tags

 
rehans oberoi
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which two are true about the jstl core iteration custom custom tags
(choose two )

1. it may iterate over arrays , collections , maps and strings
2. the body of the tag may contain EL code , but not scripting code
3.when looping over collections , a loop status object may be used
in the tag body .
4. it may iterate over a map , but only the key of the mapping may
be used in the tag body
5. when looping over integers (for example begin i= '1' end = '10')
a loop status object may not be used in the tag body


hi ranchers
which is the most appropriate answer
according to u

thanks
[ December 15, 2005: Message edited by: rehans oberoi ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1,3
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

2. the body of the tag may contain EL code , but not scripting code



Excerpt from c.tld(Core)


[ December 15, 2005: Message edited by: Vishnu Prakash ]
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

5. when looping over integers (for example begin i= '1' end = '10')
a loop status object may not be used in the tag body


I feel 5th is also correct. As even without LoopTagStatus we can iterate from 1 to 10.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tricky indeed.

I read it as :
5. when looping over integers (for example begin i= '1' end = '10')
a loop status object CAN not be used in the tag body

which would be false, because a loop status can also be used in this case.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

(choose two )


Now we got 3 correct answers.
 
Lakshmi Narayanan
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2. the body of the tag may contain EL code , but not scripting code

I have question on this.
What is the meaning not scripting code. I can do this.
<cx:forEach var="temp" items="${requestScope.list}" >
<cx ut value="${temp}" />
<%=mb.getLabel()%>
<%
out.println("Lakshjssss");
%>
</cx:forEach>

It means this should be true right because body-content is JSP. it allows everything
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic