-
3 Nov 2011 2:16 PM #31
I have uploaded all the jar files in the WEB-INF/lib folder and uploaded it. Please download it using this url
https://docs.google.com/open?id=0B2D...EyZjAxNmVmMzM0
The url 'http://localhost:8080/resolve/service/api-debug.js' indicates the router url as '/resolve/service/router' but I think my server generates a different path for the router. Not sure how to find out what is the service url of the router for my application server. Any idea?
This is my api-debug.js
Thanks,Code:Ext.ns('Ext.app');Ext.app.REMOTING_API = { "actions" : { "extjsExamplesController" : [ { "name" : "getTreeStreams1", "len" : 1 } ] }, "type" : "remoting", "url" : "/resolve/service/router"};
Jeet.
-
3 Nov 2011 11:30 PM #32
I was able to reproduce the 406 error. The problem was the classpath. All the spring libraries (org.springframework.*) were version 3.0.0. I replaced all of them with the 3.0.6 version and deleted spring-webmvc-3.0.6.RELEASE.jar because you already had this library in the classpath (org.springframework.web.servlet.jar).
After upgrade to 3.0.6 the 406 error disappeared.
-
4 Nov 2011 6:16 AM #33
GREAT...so now I need to plan to upgrade to Spring 3.0.6...
Will it be ok if I directly upgrade to latest Spring 3.1? Is it possible to support the 3.0 version in case we decide that it is not a good time for our product for the upgrade?
Please advise.
Thanks for all your effort and support.
Jeet
-
4 Nov 2011 6:29 AM #34
The library is developed with the latest 3.0.x version. But all the demos on http://extdirectspring.ralscha.ch/demo/ and http://e4ds.ralscha.ch/ are running with Spring 3.1 RC1.
So it should be okay to use both versions.
It looks like the library only has problems with old 3.0.x versions or there where bugs in these old versions.
-
7 Nov 2011 2:28 PM #35
I have now updated my spring jar files to the latest 3.1 version. There is no error but the application is not working either. The request is NOT REACHING the server and no response is coming back. This is what I have now.
- web.xml
- url 'http://localhost:8080/resolve/extjs/api-debug.js' works great. Here is the outputCode:<servlet-mapping> <servlet-name>resolve</servlet-name> <url-pattern>/extjs/*</url-pattern> </servlet-mapping>
- my index.htmlCode:Ext.ns('Ext.app');Ext.app.REMOTING_API = { "actions" : { "extjsExamplesController" : [ { "name" : "getTreeStreams3", "len" : 0 } ] }, "type" : "remoting", "url" : "/resolve/extjs/router"};
- my modelCode:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title id="page-title">Resolve Social</title> <link rel="stylesheet" type="text/css" href="../js/extjs4/resources/css/ext-all.css"> <style type="text/css"> </style> <script type="text/javascript" src="../js/extjs4/ext-debug.js"></script> <script src="/../resolve/extjs/api-debug.js"></script> <script type="text/javascript" > Ext.require([ 'Ext.direct.*' ]); Ext.onReady(function() { Ext.direct.Manager.addProvider(Ext.app.REMOTING_API); }); </script> <script type="text/javascript" src="app.js"></script> </head> <body> </body> </html>
- my java classCode:Ext.define('RS.model.Task', { extend: 'Ext.data.Model', fields: [ {name: 'task', type: 'string'}, {name: 'user', type: 'string'}, {name: 'duration', type: 'string'} ], proxy: { //type: 'ajax', //url: 'data/treegrid.json' //the store will get the content from the .json file //url : '/resolve/service/example/wiki/extjs' type:'direct', /* api : { read : extjsExamplesController.getTreeStreams2 //create : userService.create, //update : userService.update, //destroy : userService.destroy }, reader : { root : 'records' }*/ directFn : extjsExamplesController.getTreeStreams3 } });
Here is the screen shot. Note that the router response is empty. Am I missing any step? please advise.Code:public class ExtjsExamplesController { private static int counter = 0; public static class Task { public String task; public String user; public String duration; } @ExtDirectMethod(group = "treeStreams") public List<Task> getTreeStreams3(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Task> list = new ArrayList<Task>(); Task t = new Task(); t.task = "test"; t.user = "jeet"; t.duration = "0.0"; list.add(t); return list; } }
ext direct client side error.jpg
Thanks,
Jeet.
-
7 Nov 2011 6:18 PM #36
The post in the screen shot looks okay. I guess data has to be null, because getTreeStreams3 does not expect a parameter.
The response code 200 looks good as well. But there is no screenshot of the response the server send back to the client.
-
7 Nov 2011 6:26 PM #37
The response was empty '[]' . Also, the request did not reach the server as I had a debug set on that api. So I know if it is called or not. It did not got invoked.
-
7 Nov 2011 7:10 PM #38
I have no idea. The response code 200 looks okay. I guess the request reached the server because of that response code. Do you have a sample project I can try?
-
8 Nov 2011 9:36 AM #39
I understand that the request reached the server but somehow the code was not executed. That is weird as there is no error and nothing is working either.

It will take me sometime just to create a sample project in tomcat as there are too many things on my plate right now. I have attached all the related files here and will upload a test project as soon as I get a chance. By that time, if you get some ideas by looking at the files, please let me know.
extDirectFiles.zip
Thanks for all your responses and information. You have been a great help.
Please keep posting.
Jeet
-
9 Nov 2011 11:56 AM #40
Thanks for your files.
Please let me know you have changed anything (in web.xml or any other file) to make it work.
Jeet
Similar Threads
-
Ext + Java + Spring + DWR
By sfwalter in forum Community DiscussionReplies: 59Last Post: 13 Dec 2010, 3:31 AM -
Ext JS 3.1 And Spring Webflow 2.0.8 Integration
By erosszz in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 2 Feb 2010, 11:33 PM -
Ext.Direct width Spring??
By jonathanlarav in forum Ext.DirectReplies: 0Last Post: 1 Jun 2009, 5:10 PM -
Ext GWT and Spring MVC
By Ivan Polak in forum Community DiscussionReplies: 4Last Post: 12 May 2009, 10:55 PM -
Spring with EXT
By sshah in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 11 May 2008, 12:53 PM


Reply With Quote