The Common-Controls Tag Library

<svg:embed>

The tag inserts the SVG-Stream specified in the tag-body directly in the resulting HTML page.

The SVG-Stream is saved in the ResourceManager for this purpose. On the HTML-page, the following reference to the registered resource is written (see example):

<object data='/cc/session/svgresource.res' width='100%' height='200' type='image/svg+xml'> <embed src='/cc/session/svgresource.res' width='100%' height='200' type='image/svg+xml' pluginspage='http://www.adobe.com/svg/viewer/install/'/> </object>
The tag uses the Resource-Servlet of the CC-Framework. There must be an SVG-Viewer installed on the client system.

Body content: JSP
Tag class: EmbedTag
 

[ Syntax ]

Standard Syntax
<svg:embed
height = "String"
name = "String"
width = "String"
[ scope = "{any | page | request | dialog | session | application}" ]
>
...Body Content...

</svg:embed>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
heightString The height of the SVG-viewer window. The height may be specified in absolute or percent terms.

See HTML-Documentation

nameString The name under which the resource is to be saved in the Resource Manager.
scopeHTTPScope Specifies the Scope in which the SVG resource is to be saved in the Resource Manager.
  • any = The Bean is searched for in ever Scope.
  • page = The Bean exists as a local variable in the JSP Page.
  • request = The Bean is in the HTTP-request.
  • dialog = The Bean is in the dialog instance. This Scope can only be used in conjunction with the dialog control.
  • session = The Bean is in the HTTP-Session.
  • application = The Bean is in the Servlet context.

Annotation: The Scope page and request may not be used.

 
widthString The width of the SVG-viewer window. The height may be specified in absolute or percent terms.

See HTML-Documentation

[ Example ]

Embedded a SVG-resource.


<%@ taglib uri="http://www.common-controls.com/cc/tags-svg" prefix="svg" %>

<svg:embed width="100%" height="200" name="svgresource">
   <svg width="8cm" height="3cm" viewBox="0 0 800 300">
      <rect id="RectElement" x="300" y="100" width="300" height="100" style="fill:rgb(255,255,0)">
         <animate attributeName="x" attributeType="XML" begin="0s" dur="9s" fill="freeze" from="300" to="0"/>
         <animate attributeName="y" attributeType="XML" begin="0s" dur="9s" fill="freeze" from="100" to="0"/>
         <animate attributeName="width" attributeType="XML" begin="0s" dur="9s" fill="freeze" from="300" to="800"/>
         <animate attributeName="height" attributeType="XML" begin="0s" dur="9s" fill="freeze" from="100" to="300"/>
      </rect>
      <g transform="translate(100,100)">
         <text id="TextElement" x="0" y="0" style="font-family:Verdana; font-size:35.27; visibility:hidden">Embed SVG!
            <set attributeName="visibility" attributeType="CSS" to="visible" begin="3s" dur="6s" fill="freeze"/>
            <animateMotion path="M 0 0 L 0 100" begin="3s" dur="6s" fill="freeze"/>
            <animateColor attributeName="fill" attributeType="CSS" from="rgb(0,0,255)" to="rgb(128,0,0)" begin="3s" dur="6s" fill="freeze"/>
            <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="-30" to="0" begin="3s" dur="6s" fill="freeze"/>
            <animateTransform attributeName="transform" attributeType="XML" type="scale" from="1" to="3" additive="sum" begin="3s" dur="6s" fill="freeze"/>
         </text>
      </g>
   </svg>
</svg:embed>