<%@ taglib uri="simple-taglib.tld" prefix="jspx" %> <jspx:hello />

JSP Custom Tag Test Page

Example: 1
Simple JSP Code
num1 = 12, num2 = 9;
sum = simple jsp to show the result = <% int num1 = 12, num2 = 9; int sum = num1 + num2; out.print(sum); %>

Example: 2
The code here is <jspx:hellotest> where 'hellotest' is the tag which is looking in
the file 'simple-taglib.tld' for the corresponding file to execute

First JSP Custom Tag



Example: 3
check for cookie <%-- --%>


Example: 4
Convert all Upercase to Lowercase
Convert All Upercase to Lowercase


Example: 5
Simple Prime
<%-- --%>

50-digit prime



Example: 6
jspx:include <%-- --%>


Example:7
    Using Arribute
  • 20 digit:
  • 80 digit:
  • Default (50-digit):


Example:8
Top of regular page. Blah, blah, blah. Yadda, yadda, yadda.

Debug:

  • Current time: <%= new java.util.Date() %>
  • Requesting hostname: <%= request.getRemoteHost() %>
  • Session ID: <%= session.getId() %>

Bottom of regular page. Blah, blah, blah. Yadda, yadda, yadda.


Example:9

HTML Logical Character Styles

Physical character styles (B, I, etc.) are rendered consistently in different browsers. Logical character styles, however, may be rendered differently by different browsers. Here's how your browser **** (<%= request.getHeader("User-Agent") %>) **** renders the HTML 4.0 logical character styles:

<%@ taglib uri="simple-taglib.tld" prefix="cwp" %>
ExampleResult
				
				Some emphasized text.
Some strongly emphasized text.
Some code.
Some sample text.
Some keyboard text.
A term being defined.
A variable.
A citation or reference.
Some emphasized text.
Some strongly emphasized text.
Some code.
Some sample text.
Some keyboard text.
A term being defined.
A variable.
A citation or reference.


Example:10