1. #31
    Sencha User
    Join Date
    Mar 2010
    Location
    Laguna Niguel, CA
    Posts
    62
    Vote Rating
    0
    jeetmarwah is on a distinguished road

      0  

    Default


    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
    Code:
    Ext.ns('Ext.app');Ext.app.REMOTING_API = {  "actions" : {    "extjsExamplesController" : [ {      "name" : "getTreeStreams1",      "len" : 1    } ]  },  "type" : "remoting",  "url" : "/resolve/service/router"};
    Thanks,
    Jeet.

  2. #32
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    117
    Vote Rating
    11
    ralscha will become famous soon enough

      0  

    Default


    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.

  3. #33
    Sencha User
    Join Date
    Mar 2010
    Location
    Laguna Niguel, CA
    Posts
    62
    Vote Rating
    0
    jeetmarwah is on a distinguished road

      0  

    Default


    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. #34
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    117
    Vote Rating
    11
    ralscha will become famous soon enough

      0  

    Default


    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.

  5. #35
    Sencha User
    Join Date
    Mar 2010
    Location
    Laguna Niguel, CA
    Posts
    62
    Vote Rating
    0
    jeetmarwah is on a distinguished road

      0  

    Default


    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
    Code:
    <servlet-mapping>
            <servlet-name>resolve</servlet-name>
            <url-pattern>/extjs/*</url-pattern>
        </servlet-mapping>
    - url 'http://localhost:8080/resolve/extjs/api-debug.js' works great. Here is the output
    Code:
    Ext.ns('Ext.app');Ext.app.REMOTING_API = {  "actions" : {    "extjsExamplesController" : [ {      "name" : "getTreeStreams3",      "len" : 0    } ]  },  "type" : "remoting",  "url" : "/resolve/extjs/router"};
    - my index.html
    Code:
    <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 model
    Code:
        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
    
    
    		}
        });
    - my java class
    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;
    
    
        }  
    }
    Here is the screen shot. Note that the router response is empty. Am I missing any step? please advise.
    ext direct client side error.jpg


    Thanks,
    Jeet.

  6. #36
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    117
    Vote Rating
    11
    ralscha will become famous soon enough

      0  

    Default


    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. #37
    Sencha User
    Join Date
    Mar 2010
    Location
    Laguna Niguel, CA
    Posts
    62
    Vote Rating
    0
    jeetmarwah is on a distinguished road

      0  

    Default


    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.

  8. #38
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    117
    Vote Rating
    11
    ralscha will become famous soon enough

      0  

    Default


    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?

  9. #39
    Sencha User
    Join Date
    Mar 2010
    Location
    Laguna Niguel, CA
    Posts
    62
    Vote Rating
    0
    jeetmarwah is on a distinguished road

      0  

    Default


    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

  10. #40
    Sencha User
    Join Date
    Mar 2010
    Location
    Laguna Niguel, CA
    Posts
    62
    Vote Rating
    0
    jeetmarwah is on a distinguished road

      0  

    Default


    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

  1. Ext + Java + Spring + DWR
    By sfwalter in forum Community Discussion
    Replies: 59
    Last Post: 13 Dec 2010, 3:31 AM
  2. Ext JS 3.1 And Spring Webflow 2.0.8 Integration
    By erosszz in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 2 Feb 2010, 11:33 PM
  3. Ext.Direct width Spring??
    By jonathanlarav in forum Ext.Direct
    Replies: 0
    Last Post: 1 Jun 2009, 5:10 PM
  4. Ext GWT and Spring MVC
    By Ivan Polak in forum Community Discussion
    Replies: 4
    Last Post: 12 May 2009, 10:55 PM
  5. Spring with EXT
    By sshah in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 11 May 2008, 12:53 PM

Thread Participants: 13

Tags for this Thread