Intro
Similar to ASP, which uses C#, JSP is the one with uses Java behind. To deploy those applications we need a servlet container, like Apache Tomcat or JBoss EAP – Undertow. JSP dynamic web content, as XML. Together.
Deploy
We need a servlet container so in this case, we can use Jetty for the demonstration. Eclipse Jetty is a Java HTTP (Web) server and Java Servlet container, I will talk more about it on another post.
JSP Custom TAG
One of the most interesting features in my opinion about JSP, which is a nice feature btw, is the possibility to create custom tags HTML based on the HTML rules – ofc. Just follow the template below with the attributes you need.
TEMPLATE FOR HTML 4
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<!DOCTYPE taglib
PUBLIC “-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN”
“http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd”>
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>name</short-name>
<uri>/put_your_uri</uri>
<display-name>x</display-name>
<description>JSP Tag library for CPS application </description>
<tag>
<name>your_tag_name</name>
<tag-class>your_tag</tag-class>
<body-content>JSP</body-content>
<display-name> Any content</display-name>
<description>Example</description>
<attribute>
</attribute>
JSP Html 4 vs Html 5
Jsp will validate the HTML version on the begin of the page. Please use plain simple JavaScript in case you need validation.
JSP Specification
We can see the specification here