View Poll Results: If you read it, did you find DirectJNgine User's Guide adequate?
- Voters
- 54. You may not vote on this poll
-
Yes
40 74.07% -
No
14 25.93%
-
24 Sep 2009 2:53 PM #111
Data not being loaded into store
Data not being loaded into store
Greetings,
I have read the user manual and setup directjngine-1.0 in my web app. I am trying to load data into a grid using the DirectStore. DirectStore is succesfully querying the server but the returned result is not making it into my grid. It appears the loadRecords function is being passed false for the success parameter. Any idea what is going on here?
Response:Code:var memoryRecord = Ext.data.Record.create([{ name: 'name', type: 'string', allowBlank: false },{ name: 'status', type: 'int', allowBlank: false },{ name: 'nonHeapUsed', type: 'float', allowBlank: false },{ name: 'heapUsed', type: 'float', allowBlank: false },{ name: 'heapMax', type: 'float', allowBlank: false }, { name: 'nonHeapMax', type: 'float', allowBlank: false }]); Ext.Direct.addProvider( Ext.app.REMOTING_API ); var memoryStatsStore = new Ext.data.DirectStore({ paramsAsHash: false, root: 'result', directFn: FrameworkMemoryBean.loadFrameworkMemoryInfo, idProperty: 'name', fields: memoryRecord, }); memoryStatsStore.load();
{"result":[{"heapMax":6144.0,"heapUsed":1626.252784729004,"nonHeapMax":-1.0,"nonHeapUsed":524.9034423828125,"name":"localhost","status":0}],"tid":2,"action":"FrameworkMemoryBean","method":"loadFrameworkMemoryInfo","type":"rpc"}
-
27 Sep 2009 11:12 PM #112
Hi
We need the Java code to get the whole picture.
That said, take an in-depth look at the code in DirectStore.java and how it is used in djn-tests.js. DirectStores have been fully tested in DJN, and so far they have worked without a problem.
Copy a working example/test code, make sure it works in your program, and then modify it moving towards your desired code. All too often I make little mistakes that are not easy to catch due to Javascript being way too tolerant: going step by step is a must in those cases.
Hope this helpsPedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
28 Sep 2009 12:14 AM #113Pedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
5 Oct 2009 4:24 AM #114
New webapp using directjngine
New webapp using directjngine
Hi Pedro,
I am planning to use the directjngine stack to help my project which involves calling crossdomain URLs. I must admit that I am still a beginner.
My hello message in my javascript file is coming up, which says that my EXtjs is configured properly.
I have followed the userguide to create a new web app. Now I have created my own class just like you have given and run my application. The Api.js is not getting created automatically. It does not seem to recognize my class!
I will be obliged with any help.
Thanks,
Sreevani
-
5 Oct 2009 8:46 AM #115
If you are having trouble, maybe the easiest way to make sure things will work is to use the example application to start your own app.
Just make sure you can make it work to begin with, add your own "hello world" example and then remove all unneeded functionality.
If, after trying this, things do not work, post the web.xml and your class source code.
By the way, I assume you are using JDK 1.5, right? I decided not to support earlier earlier JDKs: you can find the reason somewhere else in this thread.Pedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
14 Oct 2009 10:40 AM #116
This may be a silly question, but is batching supposed to work when polling multiple providers?
That is, let's say I set up a couple of different providers like so:
When watching the console log in Firebug, I see queries going to both provider URLs at the same time. As far as I can tell, I have DirectJNgine set up properly and everything else is working fine. I had expected that those calls would be batched together. Is there something that I'm missing?Code:Ext.Direct.addProvider({ type: 'polling', url: Ext.app.POLLING_URLS.firstMethod }); Ext.Direct.addProvider({ type: 'polling', url: Ext.app.POLLING_URLS.secondMethod }); Ext.Direct.on('firstMethod', function(result) {}); Ext.Direct.on('secondMethod', function(result) {});
I've got a web page that's currently doing a lot of polling via old-fashioned timers and AJAX calls, and I was hoping that this would make that process a lot nicer. I suppose I could just replace the AJAX calls with functions that call a remoting provider and keep the timers, but it seems like the polling providers should be able to replace that altogether...
-
14 Oct 2009 12:15 PM #117
Here's another question, this one might be tricky...
In a servlet, is there any way to get access to the HttpServletRequest that lead to that method call? I ask because I'm running Tomcat on a servet with multiple network interfaces, and I have a servlet that needs to, at runtime, determine which interface requests to Tomcat are arriving on and then use that same interface to query another server and return its status. Currently I can just call "getLocalAddr" on the HttpServletRequest to get the interface I need, but I don't see any way to do that in a method that was annotated with @DirectMethod.
-
15 Oct 2009 4:56 AM #118
No idea for the first question..sorry
You can't access the request when you are in a directAction. You need to override the DirectJNgineServlet and find a way to give the request or just the LocalAddr to the called method.(I didn't have the source I can't help you any more...)
Someone needed to access the request to keep object in session. You will found the workaround here.. https://www.extjs.com/forum/showthread.php?p=368005 .
-
15 Oct 2009 5:46 AM #119
As far as I know, the provider is the "batching unit" for Ext.Direct, so I would not expect poll calls from different providers to be batched
.
You might want to consider consolidating several poll calls into a single call that returns the aggregated results of all of them -depending on your scenario.
Regards,Pedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
15 Oct 2009 7:00 AM #120
Ah, using a filter to catch the interface address is a great idea. That's a lot cleaner than the previous way I was doing it, too. Thanks!
It's too bad you can't batch calls to different providers, but that makes sense... I'll probably consolidate a few of them and just have the less frequent, higher bandwidth calls use a remoting provider.


Reply With Quote