Portability vs Platform Independency

What is Portability? Portability is the ability to be easily carried or moved. In programming, Portability represents the ability of software to be transferred from one platform to another. Almost all high level languages such as C, C++, Java etc are portable i.e. Their applications can be executed on all platforms. How a language is […]

Encapsulation vs Abstraction

What is Encapsulation? Encapsulation is the process of putting something into a capsule. In programming, Encapsulation represents the grouping of logically related data and operations into blocks called classes. In real life context, a company can encapsulate its stakeholders into the following groups according to their functionalities: Employee, Product, Customer, Supplier, Share holder etc. Encapsulation […]

Example of BodyTag

Practical example of BodyTag: To demonstrate the example of BodyTag, I have created a custom tag which receives its body contents from the tag processor and change the case of body text. Here is the source code of the Tag and other application compoenents: The CaseChangerTag class: package com.techmentro.learningpad; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.*; public class […]

BodyTag interface of Tag API

BodyTag interface: BodyTag is a sub interface of IterationTag. It adds following method to the tag life cycle: setBodyContent: This method facilitate processing of the tag body by the Tag itself. It has following syntax: In addition to this method, the BodyTag interface defines BodyTag.EVAL_BODY_BUFFERED static final int data member to be used as a […]

IterationTag interface of Tag API

IterationTag interface: IterationTag is a sub interface of Tag. It adds following method to the tag life cycle: doAfterBody: This method facilitate iterative processing of tag body i.e. processing of the body more than once. It is invoked by the Tag processor only if the tag has non empty body and doStartTag() method returns EVAL_BODY_INCLUDE. […]