Java JSP – Using Abstract Class

        <TITLE>Using Abstract Classes</TITLE>

        <H1>Using Abstract Classes</H1>

            javax.servlet.jsp.JspWriter localOut;

            abstract class a {
                abstract String getText() throws;

                public void printem() throws {

            class b extends a {
                String getText() throws {
                    return "Hello from JSP!";
            localOut = out;     

            b bObject = new b();


Java JSP – JSTL Date Format Example

This example show how to format date in JSP using format tag library.

<%@ taglib uri="" prefix="fmt" %>

    <jsp:useBean id="date" class="java.util.Date"/>
    Today is: <fmt:formatDate value="${date}" type="date" pattern="dd-MMM-yyyy"/>


Java JSP – Comments Example

Following is the syntax of JSP comments:

<%-- This is JSP comment --%>

Following is the simple example for JSP Comments:

<head><title>A Comment Test</title></head>
<h2>A Test of Comments</h2>
<%-- This comment will not be visible in the page source --%>

Page 1 of 3123