Hi ,
I am new in GWT.
I am trying to develp an application using GWT+Spring .
following are application code
1) MyApplication .java
package com.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.ui.*;
// Referenced classes of package csw.client MyService, MyServiceAsync
public class MyApplication implements EntryPoint {
public MyApplication() {
}
public void onModuleLoad() {
final Label label = new Label();
final MyServiceAsync svc = (MyServiceAsync)
GWT.create(com.client.MyService.class);
ServiceDefTarget endpoint = (ServiceDefTarget) svc;
endpoint.setServiceEntryPoint("services/myService");
final AsyncCallback callback = new AsyncCallback() {
public void onSuccess(Object result) {
label.setText(result.toString());
}
public void onFailure(Throwable ex) {
label.setText(ex.toString());
}
};
Button button = new Button("Click ME");
button.addClickListener(new ClickListener() {
public void onClick(Widget w) {
svc.myMethod("Do Something", callback);
}
});
RootPanel.get("testing").add(button);
RootPanel.get("testing2").add(label);
}
}
Myapplication.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>MyApplication</title>
<script type="text/javascript" language="javascript"
src="com.MyApplication.nocache.js"></script>
</head>
<body>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'
style="position:absolute;width:0;height:0;border:0">
</iframe>
<table align="center">
<tr><td id="testing"></td>
<td id="testing2"></td>
</tr>
</table>
</body>
</html>
Myapplication.gwt.xml
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='com.company.client.MyApplication'/>
<!-- Specify the application specific style sheet. -->
<stylesheet src='MyApplication.css' />
</module>
when I run MyApplication-shell command
I got click me button.
But when i click on click me button I got following exception.
[WARN] StandardContext[]Error loading WebappClassLoader
delegate: false
repositories:
----------> Parent Classloader:
sun.misc.launcher$appclassloa...@11b86e7
org.springframework.web.servlet.DispatcherServlet
java.lang.ClassNotFoundException:
org.springframework.web.servlet.DispatcherServlet
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---