Showing posts with label AJT. Show all posts
Showing posts with label AJT. Show all posts

New JSP XML synatext



There is a used below types of JSP synaxt are used which is XHTML and SVG type javascripts are used.There is also describe how to used each tags and gives basic documen for illustrates that is used.

There is also describes how to illustrates of each tags of XHTML and contains that change from the html.There is more difference from html.The main difference is how to tags used.The tags are used in sequence manner.
 
1) XHTML Basic Example

<tags:xhtmlbasic xmlns:tags="urn:jsptagdir:/WEB-INF/tags"
                 xmlns:jsp="http://java.sun.com/JSP/Page"
                 xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
                                xmlns="http://www.w3.org/1999/xhtml">
  <jsp:directive.page contentType="text/html" />
  <head>
    <title>JSPX - XHTML Basic Example</title>
  </head>
  <body>
    <h1>JSPX - XHTML Basic Example</h1>
    <hr/>
    This example illustrates how to use JSPX to produce an XHTML basic
    document suitable for use with mobile phones, televisions, 
    PDAs, vending machines, pagers, car navigation systems,
    mobile game machines, digital book readers, smart watches, etc.
    <p/>
    JSPX lets you create dynamic documents in a pure XML syntax compatible
    with existing XML tools.  The XML syntax in JSP 1.2 was awkward and
    required &amp;lt;jsp:root&amp;gt; to be the root element of the document.


    This is no longer the case in JSP 2.0.
    <p/>
    This particular example uses a tag file to produce the DOCTYPE and
    namespace declarations to make the output of this page a valid XHTML
    Basic document.
    <p/>
    Just to proove this is live, here's some dynamic content:
    <jsp:useBean id="now" class="java.util.Date" />
    <fmt:formatDate value="${now}" pattern="MMMM d, yyyy, H:mm:ss"/>
  </body>
</tags:xhtmlbasic>
(2) SVG (Scalable Vector Graphics)
<!-- 
  - This example is based off the textRotate.svg example that comes
  - with Batik.  The original example was written by Bill Haneman.
  - This version by Mark Roth.
  -->
<svg xmlns="http://www.w3.org/2000/svg"
     width="450" height="500" viewBox="0 0 450 500"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:jsp="http://java.sun.com/JSP/Page">
 


  <jsp:directive.page contentType="image/svg+xml" />
  <title>JSP 2.0 JSPX</title>
  <!-- select name parameter, or default to JSPX -->
  <c:set var="name" value='${empty param["name"] ? "JSPX" : param["name"]}'/>
  <g id="testContent">
    <text class="title" x="50%" y="10%" font-size="15" text-anchor="middle" >
            JSP 2.0 XML Syntax (.jspx) Demo</text>
    <text class="title" x="50%" y="15%" font-size="15" text-anchor="middle" >
            Try changing the name parameter!</text>
    <g opacity="1.0" transform="translate(225, 250)" id="rotatedText">
      <c:forEach var="i" begin="1" end="24">
        <jsp:text>
          <![CDATA[<g opacity="0.95" transform="scale(1.05) rotate(15)">]]>
        </jsp:text>
        <text x="0" y="0" transform="scale(1.6, 1.6)" fill="DarkSlateBlue" 
              text-anchor="middle" font-size="40" font-family="Serif" 
              id="words">${name}</text>
      </c:forEach>
      <c:forEach var="i" begin="1" end="24">
        <jsp:text><![CDATA[</g>]]></jsp:text>
      </c:forEach>
      <text style="font-size:75;font-family:Serif;fill:white" 
            text-anchor="middle">${name}</text>
    </g>


  </g>
</svg>