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%
-
28 Jul 2010 6:07 AM #331
Have you set the "valueField" config item on your combo box? That should tell your combo box which field in its store to use as the "value" when submitting data.
Anyway, I haven an unrelated problem I could use advice on...
I have a Java class that has its ActionScope set to Scope.SESSION. I want each user session to have its own set of member variables when interacting with this class, and I also want those variables to be cleaned up when the session ends, so that seems like a good way to do it.
I also want to have a button in the GUI that, when clicked, will prompt the user to download a text file. The way I usually do this kind of thing is to have an invisible iframe in the page and set the src of the iframe to the URL of the servlet that is providing the file, and in that servlet I set the Content-Type of the request appropriately and set the Content-Disposition to "attachment".
My problem is that the data I want the user to be able to download is stored in a member variable in the class whose scope is Scope.SESSION. How can I get that data to the iframe? Since all I can do to the iframe is set its URL, all I can do is make a plain HTTP GET request and pass parameters as arguments through the URL. I've tried manually crafting an Ext.Direct call to my DirectJNgine class, but DirectJNgine has some sort of NullPointerException when processing that. I've also thought about having a normal servlet respond to the request that uses "WebContextManager.get().getSessionScopedObject()" to look up that session's instance of my DirectJNgine class, but it seems like WebContextManager.get() always returns null when it's not called within a DirectJNgine call. I'm kind of at a loss here. Any other ideas?
-
8 Aug 2010 8:27 AM #332
Sorry to reply so late, but I've been on vacation :-)
DirectJNgine stores session scoped object in the HttpSession, and you can get them from there from anywhere in your Java code. To do that, you will need to write code similar to this:
The only thing you need to know is the action name corresponding to the session scoped object -which you set yourself or is the default one assigned by DJN, the class name.Code:HttpSession context = ...you will have to get the session on your own String key = WebContext.getSessionScopedActionName(actionName); Object result = context.getAttribute(key); return result;
I think that you will be able to write the necessary plumbing to call that code starting from your iframe.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/
-
10 Aug 2010 12:29 AM #333
Hello, I'll try to use DirectJNgine but I've some problems. I'll read and do the exemples in the documentation and It's work quite well.
But there are something that I don't understand, I don't arrive to generate automatically the Api.js.
Here is my web.xml
I use Eclipse Helios IDE.Code:<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>Efficacenergie-server</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>DjnServlet</servlet-name> <servlet-class>com.softwarementors.extjs.djn.servlet.DirectJNgineServlet</servlet-class> <init-param> <param-name>providersUrl</param-name> <param-value>djn/directprovider</param-value> </init-param> <init-param> <param-name>apis</param-name> <param-value> apiProjet </param-value> </init-param> <init-param> <param-name>apiProjet.apiFile</param-name> <param-value>js/Api.js</param-value> </init-param> <init-param> <param-name>apiProjet.apiNamespace</param-name> <param-value>Ext.app</param-value> </init-param> <init-param> <param-name>apiProjet.classes</param-name> <param-value> fr.efficacenergie.servlets.CPasserelle </param-value> </init-param> <init-param> <param-name>createSourceFiles</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>DjnServlet</servlet-name> <url-pattern>/djn/directprovider/*</url-pattern> </servlet-mapping> </web-app>
Thanks for your help.
-
10 Aug 2010 10:23 AM #334
Hi!
Just in case, check that the directory where you want to dump the api file exists.
If that does not solve the issue, set logging to very high (check the User's Guide for details), and post the full log you get when starting the webapp.
And, I think you must be getting some exception: check it and post it here, please.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/
-
10 Aug 2010 10:40 PM #335
Hi,
My problem is that Tomcat don't throw any exception. That's why I don't know where the problem is.
Code:11 août 2010 08:34:43 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave Systems Corp\Gemalto\Access Client\v5\;c:\Program Files\Fichiers communs\Roxio Shared\DLLShared\;c:\Program Files\Fichiers communs\Roxio Shared\10.0\DLLShared\;;C:\Program Files\NTP\bin 11 août 2010 08:34:43 org.apache.tomcat.util.digester.SetPropertiesRule begin ATTENTION: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Efficacenergie-server' did not find a matching property. 11 août 2010 08:34:43 org.apache.tomcat.util.digester.SetPropertiesRule begin ATTENTION: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Exemple-DirectJNgine' did not find a matching property. 11 août 2010 08:34:43 org.apache.coyote.http11.Http11Protocol init INFO: Initialisation de Coyote HTTP/1.1 sur http-8080 11 août 2010 08:34:43 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 484 ms 11 août 2010 08:34:43 org.apache.catalina.core.StandardService start INFO: Démarrage du service Catalina 11 août 2010 08:34:43 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.29 log4j:WARN No appenders could be found for logger (com.softwarementors.extjs.djn.servlet.DirectJNgineServlet). log4j:WARN Please initialize the log4j system properly. 11 août 2010 08:34:44 org.apache.coyote.http11.Http11Protocol start INFO: Démarrage de Coyote HTTP/1.1 sur http-8080 11 août 2010 08:34:44 org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 11 août 2010 08:34:44 org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/32 config=null 11 août 2010 08:34:44 org.apache.catalina.startup.Catalina start INFO: Server startup in 1031 ms
-
12 Aug 2010 4:15 AM #336
Greetings,
First of all I tried to send a comment on your blog, but I faced a blank page. Seems your blog engine don't work as expected
Then ... don't you think using the bugtracker/forum/mailling-list and other great features of Google code would be better than using a single thread in the Sencha forum ?
I understand that it was sufficient at the begin of your project, but your going to have more and more user, and this thread is already 34 pages long... not perfect to do some search and see if a problem was already resolved.
And finally, I just wanna know if some of you already experienced some socket connection failure with DirectJNgine, from time to time I'v got an exception:
I haven't investigated to see the root cause, it's perhaps on my side, but I wonder if someone else seen this exception...Code:Caused by: java.io.IOException: Stream closed at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:406) at org.apache.catalina.connector.CoyoteReader.read(CoyoteReader.java:99) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1128) at org.apache.commons.io.IOUtils.copy(IOUtils.java:1104) at org.apache.commons.io.IOUtils.toString(IOUtils.java:399) at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.process(JsonRequestProcessor.java:107)
Thanks
Alois Cochard
http://www.twitter.com/aloiscochard
http://aloiscochard.blogspot.com
-
12 Aug 2010 4:17 AM #337
-
12 Aug 2010 11:16 AM #338
Will check what's going on with the blog, thanks!
Haven't seen this "Stream closed" problem and nobody else has reported it before.
Let us know your findings!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/
-
12 Aug 2010 11:22 PM #339
Thanks for the fast answer

After some investigation, that "Stream closed" problem is cleary not on your side ! Sorry
We haven't found the root cause yet, but it's cleary on our code
See you,
Alois Cochard
http://aloiscochard.blogspot.com
http://www.twitter.com/aloiscochard
-
13 Aug 2010 4:13 AM #340



Reply With Quote