JSP is a Java view technology running on a server which allows you to write template text in client side languages like HTML, CSS, JavaScript and so on. JSP supports the so-called taglibs which are backed by pieces of Java code with which you can control the page flow and/or output dynamically (programmatically). A well known taglib is JSTL. JSP also supports Expression Language (EL), with syntax like ${}
which can be used to access backend data (actually, the attributes which are available in page, request, session and application scopes), mostly in combination with taglibs.
Usually for adding static content to a HTML page,we use either
link rel="import" tag (in HTML5) or jQuery .load("")
to include any external content.In case of any dynamic content,using JSP,we use
jsp:include
to include such content.But for cases,when we want to add custom content,which can interact with the existing content,we use custom JSP tags.They allow us to generate custom content,based on params from the caller and also pass back values processed in the custom tag back to the caller.
References:
To see the source code of java class translated by container of JSP page:
Eclipse: WORKSPACE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\PROJECT_NAME\org\apache\jsp\PAGENAME_jsp.java
Netbeans: Right-click on page and select view servlet