Scalable Vector Graphics is a language that will help make Rich Internet Client Applications a reality. This article will show you how to embed SVG files in JSP using Sun Java Studio Creator.
Using Sun Java Studio Creator with SVG - Embedding into a JSP page (Page 4 of 4 )
Embedding SVG files works in the same way as embedding in an HTML page. The next paragraph shows the source code of the AddSvg.jsp page with embedded circles.svg.
The source code for this page, DSvg.html, is as follows;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body> <embed src="resourcesUnicode.svg"
width="400" height="400"
type="image/svg+xml"/> </body>
</html>
The page which gets rendered appears as follows:
Summary
Sun Java Studio Creator supports embedding of SVG files in both HTML and JSP pages. It would have been quite simple to arrange adding files with arbitrary extensions to the resources folder. The present workaround is one way of getting the SVG files into a project. There could be other ways of doing this as well. Unicode.svg displays differently in IE 6.0 and IE 7.0 for some of the South Indian characters, which is probably due to the differences in the viewers. Readers who may be interested in the original SVG files may write to the author, as the files in the article may get changed as they pass through transformation during article editing.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.