Simple Demo for DWR. Error Class Undefined

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Simple Demo for DWR. Error Class Undefined

vishal
I am new to DWR.

want to user it in simpe JSP-Servlet example.
I am using it as pwe The quick start for DWR.

My jsp pages script is:
<script type='text/javascript' src='/TestDWR/dwr/engine.js'></script><script type='text/javascript' src='/TestDWR/dwr/interface/Demo.js'></script><script type='text/javascript' src='/TestDWR/dwr/util.js'></script>
<script type="text/javascript"> function test() { //alert("Hi"); TestDWR.getDWR(42, { callback : function(str) { alert("---"+str);}, errorHandler:function(message) { alert("Oops: " + message); } }); } </script>

I am calling the test function like this:
<input type="button" value="submit" onclick="test()"/>

Java class is:
package com.atos.dwr;

public class TestDWR {
       
       
        public String getDWR(int data){
               
                String d=data+" from class";
                System.out.println("---in class----");
                return d;
        }

}


everything worked fine for the DWR test page as per the instructions on quick start to dwr.
But when running the jsp.
it isa saying TestDWR class is underfined and nothing happening.

Please help me to solve this simple issue.
I am using everything in eclipse.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Simple Demo for DWR. Error Class Undefined

david@butterdev.com
<script type='text/javascript'
src='/TestDWR/dwr/interface/Demo.js'></script>

Should be:

<script type='text/javascript'
src='/TestDWR/dwr/interface/TestDWR.js'></script>

assuming the rest of your configuration is correct.

We have a good troubleshooting page that you should look at for further
issues:
http://directwebremoting.org/dwr/support/common_problems.html

On 01/14/2012 12:56 AM, vishal wrote:

> I am new to DWR.
>
> want to user it in simpe JSP-Servlet example.
> I am using it as pwe The quick start for DWR.
>
> My jsp pages script is:
>
>
>
>
>
>
>
> I am calling the test function like this:
> <input type="button" value="submit" onclick="test()"/>
>
> Java class is:
> package com.atos.dwr;
>
> public class TestDWR {
>
>
> public String getDWR(int data){
>
> String d=data+" from class";
> System.out.println("---in class----");
> return d;
> }
>
> }
>
>
> everything worked fine for the DWR test page as per the instructions on
> quick start to dwr.
> But when running the jsp.
> it isa saying TestDWR class is underfined and nothing happening.
>
> Please help me to solve this simple issue.
> I am using everything in eclipse.
>
> --
> View this message in context: http://dwr.2114559.n2.nabble.com/Simple-Demo-for-DWR-Error-Class-Undefined-tp7186986p7186986.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Simple Demo for DWR. Error Class Undefined

vishal
Hi David,

Thanks for your quick reply.

I guess Demo.js is the file that is been created automatically. when we have written something like this in dwr.xml



<dwr>
  <allow>
    <create creator="new" javascript="JDate">
      <param name="class" value="java.util.Date"/>
    </create>
    <create creator="new" javascript="Demo">
      <param name="class" value="com.atos.dwr.TestDWR"/>
      <include method="getDWR" />
    </create>
  </allow>
</dwr>


Well thanks though I have tried after TestDWR.js and it worked.

thanks a lot for giving the solution.

looking forward to same help from you.


regards,
vishal






On 14 January 2012 18:45, [hidden email] [via DWR] <[hidden email]> wrote:
<script type='text/javascript'
src='/TestDWR/dwr/interface/Demo.js'></script>

Should be:

<script type='text/javascript'
src='/TestDWR/dwr/interface/TestDWR.js'></script>

assuming the rest of your configuration is correct.

We have a good troubleshooting page that you should look at for further
issues:
http://directwebremoting.org/dwr/support/common_problems.html

On 01/14/2012 12:56 AM, vishal wrote:

> I am new to DWR.
>
> want to user it in simpe JSP-Servlet example.
> I am using it as pwe The quick start for DWR.
>
> My jsp pages script is:
>
>
>
>
>
>
>
> I am calling the test function like this:
> <input type="button" value="submit" onclick="test()"/>
>
> Java class is:
> package com.atos.dwr;
>
> public class TestDWR {
>
>
> public String getDWR(int data){
>
> String d=data+" from class";
> System.out.println("---in class----");
> return d;
> }
>
> }
>
>
> everything worked fine for the DWR test page as per the instructions on
> quick start to dwr.
> But when running the jsp.
> it isa saying TestDWR class is underfined and nothing happening.
>
> Please help me to solve this simple issue.
> I am using everything in eclipse.
>
> --
> View this message in context: http://dwr.2114559.n2.nabble.com/Simple-Demo-for-DWR-Error-Class-Undefined-tp7186986p7186986.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>




If you reply to this email, your message will be added to the discussion below:
http://dwr.2114559.n2.nabble.com/Simple-Demo-for-DWR-Error-Class-Undefined-tp7186986p7187547.html
To unsubscribe from Simple Demo for DWR. Error Class Undefined, click here.
NAML

Loading...