dwr still functions with invalid dwr.xml

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

dwr still functions with invalid dwr.xml

by John Ryder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm new to DWR.  I'm working on building a web portal for a legacy database.  I'm using DWR 3.0.0.116.rc1 with Spring 2.5.6 on Tomcat 6.0.18 and Sun JDK 1.6.0_16.   After i'd worked through the examples, I configured my application like this:

<dwr>
    <allow>
        <create creator="spring" javascript="FooAjaxBean">
            <param name="beanName" value="fooAjaxBean" />
            <include method="loadFooRecords" />
            <convert converter="bean" match="com.bar.FooRecord"/>
        </create>
    </allow>
</dwr>

I was receiving strange errors when trying to map my FooRecords to a dojo grid.  I did some digging in the logs and turned up these messages:

2009-10-23 13:19:35,388 WARN [org.directwebremoting.impl.DTDEntityResolver] - <Deprecated public id in dwr.xml. Use: <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 3.0//EN" "http://getahead.org/dwr//dwr30.dtd">>
....
2009-10-23 13:19:35,394 ERROR [org.directwebremoting.util.LogErrorHandler] - <Line=10 The content of element type "create" must match "(param|include|exclude|auth|filter)*".>

and later, when I made my Ajax call:

2009-10-23 13:19:45,255 ERROR [org.directwebremoting.impl.DefaultConverterManager] - <No converter found for 'com.bar.FooRecord'>

Looking at the log messages, it's obvious that i misconfigured dwr by placing a <convert> tag within a <create> tag, and that i was using an outdated doctype.  I should have validated within Eclipse before deploying locally.  Even so, DWR recognized the error and chose to continue parsing the invalid XML config file.  I think it would be nice if DWR failed to initialize upon an invalid configuration (similar to Spring Framework).  Thoughts on this?

Keep up the good work on a great open source project.

Regards,

John Ryder


Re: dwr still functions with invalid dwr.xml

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

By design DWR will try its best to work even if the input is incorrect. This may be controversial but it's the chosen path.

Regards

On Fri, Oct 23, 2009 at 4:07 PM, John Ryder <jcr216@...> wrote:
I'm new to DWR.  I'm working on building a web portal for a legacy database.  I'm using DWR 3.0.0.116.rc1 with Spring 2.5.6 on Tomcat 6.0.18 and Sun JDK 1.6.0_16.   After i'd worked through the examples, I configured my application like this:

<dwr>
    <allow>
        <create creator="spring" javascript="FooAjaxBean">
            <param name="beanName" value="fooAjaxBean" />
            <include method="loadFooRecords" />
            <convert converter="bean" match="com.bar.FooRecord"/>
        </create>
    </allow>
</dwr>

I was receiving strange errors when trying to map my FooRecords to a dojo grid.  I did some digging in the logs and turned up these messages:

2009-10-23 13:19:35,388 WARN [org.directwebremoting.impl.DTDEntityResolver] - <Deprecated public id in dwr.xml. Use: <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 3.0//EN" "http://getahead.org/dwr//dwr30.dtd">>
....
2009-10-23 13:19:35,394 ERROR [org.directwebremoting.util.LogErrorHandler] - <Line=10 The content of element type "create" must match "(param|include|exclude|auth|filter)*".>

and later, when I made my Ajax call:

2009-10-23 13:19:45,255 ERROR [org.directwebremoting.impl.DefaultConverterManager] - <No converter found for 'com.bar.FooRecord'>

Looking at the log messages, it's obvious that i misconfigured dwr by placing a <convert> tag within a <create> tag, and that i was using an outdated doctype.  I should have validated within Eclipse before deploying locally.  Even so, DWR recognized the error and chose to continue parsing the invalid XML config file.  I think it would be nice if DWR failed to initialize upon an invalid configuration (similar to Spring Framework).  Thoughts on this?

Keep up the good work on a great open source project.

Regards,

John Ryder