JSP 2.0 SVG Example
This example uses JSP 2.0's new, simplified JSPX syntax to render a
Scalable Vector Graphics (SVG) document. When you view the source,
notice the lack of a <jsp:root> element! The text to be rendered
can be modified by changing the value of the name parameter.
SVG has many potential uses, such as searchable images, or images
customized with the name of your site's visitor (e.g. a "Susan's Store"
tab image). JSPX is a natural fit for generating dynamic XML content
such as SVG.
To execute this example, follow these steps:
- Download Apache Batik,
or any other SVG viewer.
- Copy the following URL:
http://localhost:8080/examples/jsp/jsp2/jspx/textRotate.jspx?name=JSPX
- Paste the URL into Batik's Location field and press Enter
- Customize by changing the name=JSPX parameter
The following is a screenshot of the resulting image, for those that
don't have an SVG viewer: