Generalized iterating tags // User probably disconnected …

Generalized iterating tags // User probably disconnected … // Log and throw a JspTagException } if(elementsList.hasNext()) { exportVariables(); return EVAL_BODY_TAG; } return SKIP_BODY; } protected abstract void fetchIterationSupport() b throws JspException; protected void exportVariables() c throws JspException { pageContext.setAttribute(id, elementsList.getNext()); } protected void clearProperties() d { id = null; super.clearProperties(); } protected void clearServiceState() e { elementsList = null; } } B First override point. The specialized tag must implement this method to create and set an IterationSupport object The first method that tags can and must override is fetchIterationSupport(). This abstract method is the location wherein the overriding tag should implement the creating and setting of the IterationSupport object and any specialized iteration tag must provide such objects to make the generic infrastructure work. If problems rise within fetchIterationSupport(), it can throw a JspException that the generic implementation will pass to the JSP runtime. C Second override point. The specialized tag may want to export additional objects The second method that can be overridden is exportVariables(), which is where the generic iteration tag exports the iterator (based in the id attribute). An overriding tag may override this method to add more variables. For example, a certain tag iterates a hash table and wants to export both the key to the table and the value itself. In this case you would like to add the exportation of the value variable along with the default iterator.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Java Web Hosting services

Bookmark the permalink.

Comments are closed.