• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

mock 5 - 78% score - experiences  RSS feed

 
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
 
This is my favorite tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!