DWR embedded in SVG

View: New views
2 Messages — Rating Filter:   Alert me  

DWR embedded in SVG

by Vertai :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi all,

 

I try to use DWR embedded in a svg document.

It does’n work and I get always the same message :

 

‘  Document cookie has no properties’

 

How can I fix it ?

 

Here is a very litle sample.

 

<%

      response.setContentType("text/xml");

      //response.getWriter().println("toto");

%>

<html xmlns="http://www.w3.org/1999/xhtml"

      xmlns:svg="http://www.w3.org/2000/svg"

      xmlns:xlink="http://www.w3.org/1999/xlink" >

<meta http-equiv="refresh" content="20"/>

<body bgColor="oldlace">

 

<svg:svg width="300" height="200">

<svg:script type='text/javascript' xlink:href='/test/dwr/interface/BuildMenu.js'></svg:script>

<svg:script type='text/javascript' xlink:href='/test/dwr/engine.js'></svg:script>

<svg:script type='text/javascript' xlink:href='/test/dwr/util.js'></svg:script>

 

<!-- ECMAScript to change the radius with each click -->

<svg:script type="text/javascript"> <![CDATA[  function circle_click(evt) {

alert('ici');

var obj        = evt.target;

var cibleId = evt.target.getAttributeNS(null , 'id') + 'L';

var svgdoc  = evt.target.ownerDocument;

var objet   = svgdoc.getElementById(cibleId);

var show    = objet.getAttributeNS(null, 'display');

obj.setAttribute('text-decoration', show=='none' ? 'normal' : 'line-through');

objet.setAttribute('display', show=='none' ? 'inline' : 'none');

try {

      alert('avt appel');

 

   BuildMenu.getDmgr(handleGetDmgr);

} catch(e) {

      alert("error -> " + e);

}

alert('ici 2');

}

function handleGetDmgr(str) {alert(str);}]]> </svg:script>

 

<!-- CPU -->

<svg:g transform="scale(0.3, 0.3)"><svg:rect x="100" y="100" width="400" height="400" style="fill: rgb(229, 241, 235);"/>

</body>

</html>

 

 

Best s regards

 

Bernard COLLARDEY,

 

 

 

 

Cordialement,

 

Bernard COLLARDEY,

 

 

 

 


Parent Message unknown Re: DWR embedded in SVG

by Joe Walker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

This isn't a scenario that we've ever tested for, but I don't see a reason why we shouldn't try to get it working. I've created a bug:
http://bugs.directwebremoting.org/bugs/browse/DWR-266

My suggestion would be to upgrade to the latest DWR, certainly 3.0m1, or if you can, the latest from SVN, and to extract engine.js to your local filesystem and play around to get it working.
We use cookie support for CSRF protection, so maybe there is a way of getting at the HTML document from the SVG document?

If you do find a fix, please pass it on so that others can share.

Joe.


On Thu, Jul 10, 2008 at 3:39 PM, Bernard <bernard.collardey@...> wrote:

Hi all,

 

I try to use DWR embedded in a svg document.

It does'n work and I get always the same message :

 

'  Document cookie has no properties'

 

How can I fix it ?

 

Here is a very litle sample.

 

<%

      response.setContentType("text/xml");

      //response.getWriter().println("toto");

%>

<html xmlns="http://www.w3.org/1999/xhtml"

      xmlns:svg="http://www.w3.org/2000/svg"

      xmlns:xlink="http://www.w3.org/1999/xlink" >

<meta http-equiv="refresh" content="20"/>

<body bgColor="oldlace">

 

<svg:svg width="300" height="200">

<svg:script type='text/javascript' xlink:href='/test/dwr/interface/BuildMenu.js'></svg:script>

<svg:script type='text/javascript' xlink:href='/test/dwr/engine.js'></svg:script>

<svg:script type='text/javascript' xlink:href='/test/dwr/util.js'></svg:script>

 

<!-- ECMAScript to change the radius with each click -->

<svg:script type="text/javascript"> <![CDATA[  function circle_click(evt) {

alert('ici');

var obj        = evt.target;

var cibleId = evt.target.getAttributeNS(null , 'id') + 'L';

var svgdoc  = evt.target.ownerDocument;

var objet   = svgdoc.getElementById(cibleId);

var show    = objet.getAttributeNS(null, 'display');

obj.setAttribute('text-decoration', show=='none' ? 'normal' : 'line-through');

objet.setAttribute('display', show=='none' ? 'inline' : 'none');

try {

      alert('avt appel');

 

   BuildMenu.getDmgr(handleGetDmgr);

} catch(e) {

      alert("error -> " + e);

}

alert('ici 2');

}

function handleGetDmgr(str) {alert(str);}]]> </svg:script>

 

<!-- CPU -->

<svg:g transform="scale(0.3, 0.3)"><svg:rect x="100" y="100" width="400" height="400" style="fill: rgb(229, 241, 235);"/>

</body>

</html>

 

 

Best s regards

 

Bernard COLLARDEY,

 

 

 

 

Cordialement,

 

Bernard COLLARDEY,