• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock 5 - 78% score - experiences

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. remember that in case of any directive , say for e.g -
<%@ page....%> is OR, but <%@page....%> is OK, but
<% @ page....%> is NOT OK. not the illegal space !

2. The EL code within the body of the tag may refer to the iteration variable
but scripting code cannot.



so the above thing mentioned in the mock engine is incorrect !

3. the forEach tag has a attibute called "varStatus". as said in hfsj, its
of type LoopTagStatus. I just checked the api for this class, and was
amazed to see all the method that it has. A sample code is -

<c:forEach var="i" begin="10" end="30" step="5" varStatus="status">
<c:if test="${status.first}">
begin:<c ut value="${status.begin}"/>
end:<c ut value="${status.end}"/>
step:<c ut value="${status.step}"/>
</c:if>
</c:forEach>


the variable "Status" is of type LoopTagStatus, so, the EL expressions
are like calling the methods - isFirst( ), getEnd( ), getBegin( ) and
getStep( ) of the TagSupport class. Hope this adds to the understanding
of the fellow ranchers.

4. this one is really a good catch -
when you use a for loop inside a jsp:scriptlet, not that you are in a
XML character area , which means -
for(int i = 0; i <= 5; i++ ) should be written as -
for(int i=0; i&lt;5; i++) inside a scriptlet.
this is because that the character < is taken as a starting syantag
for a XML tag ! hope i am correct !

thats all, remaining things where i went wrong were some very weird and SPECY questions on custom tags, i read the explanation but not posting it here !

hope this adds to the knowledge of ranchers !
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic