dwr icon indicating copy to clipboard operation
dwr copied to clipboard

ControllerParser has inappropriate code

Open devefx opened this issue 8 years ago • 4 comments

inappropriate code

if ("dwr:config-param".equals(child.getNodeName()))
{
    params.put(child.getAttribute("name"), child.getAttribute("value"));
}

correct

if ("config-param".equals(element.getLocalName()))
{
    params.put(child.getAttribute("name"), child.getAttribute("value"));
}

devefx avatar Jul 10 '17 02:07 devefx

Thanks for the report! @dmarginian : can you take a look at this?

mikewse avatar Jul 10 '17 16:07 mikewse

The use of the dwr namepspace is documented on our site: http://directwebremoting.org/dwr/documentation/server/integration/spring.html

If we changed this per your recommendation I believe we would break people that read and followed our documentation.

dmarginian avatar Jul 11 '17 23:07 dmarginian

@devefx I missed the change of getNodeName to getLocalName in the code you submitted. The proposed change could work, however, there are several other places in the code where we are using getNodeName (CreatorParserHelper) and relying on the dwr namespace. So the change is more invasive than just ControllerParser. Also, I would need to investigate using getLocalName as I know in some cases it may return null. I would suggest using the dwr namespace per our documentation for now.

dmarginian avatar Jul 12 '17 23:07 dmarginian

@devefx Everybody's busy so it would help a lot if you could describe the use case you want to solve. Some example code that a test case could be based off would also be great!

mikewse avatar Jul 31 '17 12:07 mikewse