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%
  1. #471
    Sencha Premium Member
    Join Date
    Jul 2007
    Location
    Sydney, Australia
    Posts
    232
    Vote Rating
    140
    seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all

      0  

    Default Patch to get 2.2 src to compile

    Patch to get 2.2 src to compile


    In order to get the 2.2 source to compile I needed to apply the following patch:
    Code:
    diff -u -r Downloads/directjngine.2.2/src/prod/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java ./src/prod/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java
    --- Downloads/directjngine.2.2/src/prod/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java    2012-05-20 19:34:52.000000000 +1000
    +++ ./src/prod/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java    2013-10-03 14:00:26.000000000 +1000
    @@ -73,7 +73,7 @@
         return new Adapter<T>(constructor, getBoundFields(gson, type, raw));
       }
     
    -  private ReflectiveTypeAdapterFactory.BoundField createBoundField(
    +  private static ReflectiveTypeAdapterFactory.BoundField createBoundField(
           final Gson context, final Field field, final String name,
           final TypeToken<?> fieldType, boolean serialize, boolean deserialize) {
         final boolean isPrimitive = Primitives.isPrimitive(fieldType.getRawType());
    HTH. Scott

  2. #472
    Sencha Premium Member
    Join Date
    Jul 2007
    Location
    Sydney, Australia
    Posts
    232
    Vote Rating
    140
    seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all

      0  

    Default Patch to allow 2.2 api to be loaded into Sencha Architect 3.0

    Patch to allow 2.2 api to be loaded into Sencha Architect 3.0


    Here is a patch to allow the DJN generated api to be loaded as a Direct Resource in Sencha Architect 3.0.

    In the patch the fact that SA3 is to be used is hardcoded.

    pagullo: It would be great if you could apply this. It would be awesome if you could spend a few more minutes and cater for a further configuration parameter in web.xml to provide a means of indicating that SA is in use.

    Code:
    diff -u -r /Users/seade/Downloads/directjngine.2.2/src/prod/com/softwarementors/extjs/djn/jscodegen/ApiCodeGenerator.java ./src/prod/com/softwarementors/extjs/djn/jscodegen/ApiCodeGenerator.java
    --- /Users/seade/Downloads/directjngine.2.2/src/prod/com/softwarementors/extjs/djn/jscodegen/ApiCodeGenerator.java    2012-07-03 10:57:04.000000000 +1000
    +++ ./src/prod/com/softwarementors/extjs/djn/jscodegen/ApiCodeGenerator.java    2013-11-14 11:24:32.000000000 +1100
    @@ -44,6 +44,10 @@
       @NonNull private RegisteredApi api;
       @NonNull private GlobalConfiguration globalConfiguration;
       
    +  /** Allow for changes to output to allow the generated api to be consumed by SA3  */
    +  // TODO Retrieve this from web.xml
    +  private static final boolean SA3 = true;
    +
       public ApiCodeGenerator( GlobalConfiguration globalConfiguration, RegisteredApi api ) {
         assert globalConfiguration != null;
         assert api != null;
    @@ -70,8 +74,15 @@
           result.append( " **********************************************************************/\n");
           result.append( "\n");
         }
    -    appendNamespaceAndProviderUrlSection(result);
    -    appendPollingUrlsSection(result, minify);
    +
    +    // Sencha Architect 3.0 customisation
    +    if (!SA3) {
    +      // SA3 does not like the namespace and provider URL sections to be specified within the file.
    +      appendNamespaceAndProviderUrlSection(result);
    +      // SA3 does not like this approach to including polling URLs
    +      // TODO Figure out what SA3 does like
    +      appendPollingUrlsSection(result, minify);
    +    }
         appendActionsSection(result, minify);
       }
     
    @@ -159,11 +170,31 @@
         assert result != null;
         
         result.append( this.api.getApiNamespace() ); result.append( ".REMOTING_API"); result.append( " = {\n" );
    +
    +    result.append("  url: ");
    +    if (SA3) {
    +      // By using a relative URL we can skip the base URL
    +      // SA3 also requires the URL to be quoted, perhaps this is acceptable for non-SA3 use as well?
    +      result.append( "'" ).append( this.globalConfiguration.getProvidersUrl() ).append( "'" );
    +    }
    +    else {
    +      // The following code depends on appendNamespaceAndProviderUrlSection() which is not invoked for SA3
    +      result.append( this.api.getApiNamespace() ); result.append( ".PROVIDER_BASE_URL") ;
    +    }
    +    result.append( ",\n" );
         
    -    result.append("  url: " ); result.append( this.api.getApiNamespace() ); result.append( ".PROVIDER_BASE_URL") ; result.append( ",\n" );
         result.append("  type: '" ); result.append( REMOTING_TYPE ); result.append( "',\n" );
         if( !this.api.getActionsNamespace().equals("")) {
    -      result.append( "  namespace: " ); result.append( this.api.getActionsNamespace()); result.append( ",\n");
    +        // SA3 requires the namespace to be quoted, perhaps this is acceptable for non-SA3 use as well?
    +        result.append( "  namespace: " );
    +        if (SA3) {
    +            result.append( "'" );
    +        }
    +        result.append( this.api.getActionsNamespace());
    +        if (SA3) {
    +            result.append( "'" );
    +        }
    +        result.append( ",\n");
         }
         result.append("  actions: {\n" );
       }
    Thanks, Scott

  3. #473
    Sencha User
    Join Date
    Feb 2009
    Posts
    1
    Vote Rating
    0
    alper is on a distinguished road

      0  

    Default Multithreaded DirectJNgine context issue

    Multithreaded DirectJNgine context issue


    Hi Guys,

    We are using DirectJNgine for a year and so and no issues so far. Our project is both Ext JS and Angular JS based, so we do JSON-RPC through the DirectJNgine with the same success. Recently we tried to switch on the multithreading, but part of our code didn't work with it. In our web.xml config file we have entries like

    Code:
     <env-entry>
        <env-entry-name>SESSION_TIMEOUT</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>60</env-entry-value>
      </env-entry>
    Then we read these config values with code like this below

    Code:
    private static Object getConfigValue(String keyName) throws NamingException { 
            InitialContext initCtx = new InitialContext();
            try {
                return initCtx.lookup("java:comp/env/" + keyName);              
            }catch(NamingException nex) {
                ...
            }
        }
    This does not work as we guess the context of the newly started thread is not the same. Is it possible to pass the initial context to the newly created threads?

    Thanks,
    Alper

  4. #474
    Sencha Premium Member
    Join Date
    Sep 2013
    Posts
    1
    Vote Rating
    0
    alin@sonatype.com is on a distinguished road

      0  

    Default Upgrade commons-fileupload to 1.3.1

    Upgrade commons-fileupload to 1.3.1


    Hi guys,

    Any plan to upgrade commons-fileupload to latest version, 1.3.1?
    Version 1.3 and 1.3.1 has some important security fixes: http://commons.apache.org/proper/com...rt.html#a1.3.1

    The changes are small to get it working with din, just implement the two new methods in DiskFileItem2. Did that locally and everything seems to work just fine.

    Thanx,
    Alin

  5. #475
    Sencha User
    Join Date
    Sep 2014
    Posts
    3
    Vote Rating
    0
    ajay_kango is on a distinguished road

      0  

    Default Server call fails with the message djn/directprovider was not found on this server

    Server call fails with the message djn/directprovider was not found on this server


    Hi I am trying to get the ext direct functionality to work in my current application. Currently using ext3.2 and doing some POC on using direct before we migrate to ext 5 to understand if this can be used in my current product.<br>
    <br>
    I have done the configuration and the Api.js etc is getting generated correctly. The problem I am facing is the url that gets created with the djn/directprovider appended gets a 404 response.<br>
    <br>
    At first I thought it was due to the CSRF security checks in my product but commenting the filters for those didn't give any success.<br>
    <br>
    Adding my configuration below please let me know if I have missed something.<br>
    <br>
    &lt;!-- New Servlet for trying to implement Ext.Direct --&gt;<br>
    <br>
    &lt;servlet&gt;<br>
    &lt;servlet-name&gt;DjnServlet&lt;/servlet-name&gt;<br>
    &lt;servlet-class&gt;com.softwarementors.extjs.djn.servlet.DirectJNgineServlet&lt;/servlet-class&gt;<br>
    <br>
    &lt;init-param&gt;<br>
    &lt;param-name&gt;debug&lt;/param-name&gt;<br>
    &lt;param-value&gt;true&lt;/param-value&gt;<br>
    &lt;/init-param&gt; <br>
    <br>
    <br>
    &lt;init-param&gt;<br>
    &lt;param-name&gt;providersUrl&lt;/param-name&gt;<br>
    &lt;param-value&gt;djn/directprovider&lt;/param-value&gt;<br>
    &lt;/init-param&gt;<br>
    <br>
    <br>
    &lt;init-param&gt;<br>
    &lt;param-name&gt;batchRequestsMultithreadingEnabled&lt;/param-name&gt;<br>
    &lt;param-value&gt;true&lt;/param-value&gt;<br>
    &lt;/init-param&gt;<br>
    <br>
    <br>
    &lt;init-param&gt;<br>
    &lt;param-name&gt;apis&lt;/param-name&gt;<br>
    &lt;param-value&gt;<br>
    demo<br>
    &lt;/param-value&gt;<br>
    &lt;/init-param&gt;<br>
    <br>
    &lt;init-param&gt;<br>
    &lt;param-name&gt;demo.apiFile&lt;/param-name&gt;<br>
    &lt;param-value&gt;demo/Api.js&lt;/param-value&gt;<br>
    &lt;/init-param&gt;<br>
    <br>
    &lt;init-param&gt;<br>
    &lt;param-name&gt;demo.apiNamespace&lt;/param-name&gt;<br>
    &lt;param-value&gt;Ext.app&lt;/param-value&gt;<br>
    &lt;/init-param&gt;<br>
    <br>
    <br>
    &lt;init-param&gt;<br>
    &lt;param-name&gt;demo.classes&lt;/param-name&gt;<br>
    &lt;param-value&gt;<br>
    org.com.ExtDirectTest<br>
    &lt;/param-value&gt;<br>
    &lt;/init-param&gt;<br>
    <br>
    <br>
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br>
    &lt;/servlet&gt; <br>
    <br>
    &lt;!-- New mapping for testing Ext.Direct --&gt;<br>
    <br>
    &lt;servlet-mapping&gt;<br>
    &lt;servlet-name&gt;DjnServlet&lt;/servlet-name&gt;<br>
    &lt;url-pattern&gt;/djn/directprovider/*&lt;/url-pattern&gt;<br>
    &lt;/servlet-mapping&gt;<br>
    <br>
    Java Class -<br>
    <br>
    <br>
    public class ExtDirectTest {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;@DirectMethod<br>
    &nbsp;&nbsp;&nbsp;&nbsp;public String renderMyAlert( String data ) {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;return data;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;}<br>
    }<br>
    <br>
    Javascript functions:<br>
    <br>
    testExtDirect = function() {<br>
    ExtDirectTest.renderMyAlert("ABC",testExtDirectCB );<br>
    };<br>
    <br>
    <br>
    testExtDirectCB = function(result){<br>
    &nbsp;&nbsp;&nbsp;&nbsp;alert(result);<br>
    };<br>
    <br>
    <br>
    API.js -<br>
    <br>
    /**********************************************************************<br>
    * <br>
    * Code generated automatically by DirectJNgine<br>
    * Copyright (c) 2009, Pedro Agulló Soliveres<br>
    * <br>
    * DO NOT MODIFY MANUALLY!!<br>
    * <br>
    **********************************************************************/<br>
    <br>
    <br>
    Ext.namespace('Ext.app');<br>
    <br>
    <br>
    Ext.app.PROVIDER_BASE_URL=window.location.protocol + '//' + window.location.host + '/' + (window.location.pathname.split('/').length&gt;2 ? window.location.pathname.split('/')[1]+ '/' : '') + 'djn/directprovider';<br>
    <br>
    <br>
    Ext.app.POLLING_URLS = {<br>
    }<br>
    <br>
    <br>
    Ext.app.REMOTING_API = {<br>
    url: Ext.app.PROVIDER_BASE_URL,<br>
    type: 'remoting',<br>
    actions: {<br>
    ExtDirectTest: [<br>
    {<br>
    name: 'renderMyAlert'/*(String) =&gt; String */,<br>
    len: 1,<br>
    formHandler: false<br>
    }<br>
    ]<br>
    }<br>
    }<br>
    <br>
    Code added to enable REMOTING_API -<br>
    <br>
    <br>
    Ext.onReady( function() {<br>
    Ext.app.REMOTING_API.enableBuffer = 0; <br>
    var remotingProvider = Ext.Direct.addProvider( Ext.app.REMOTING_API); <br>
    });<br>
    <br>
    <br>
    Error message from the server :<br>
    <br>
    <strong>Not Found</strong><br><br><font color="#464646"><span style="font-family: Segoe UI">The requested URL /contextName/djn/directprovider was not found on this server.</span></font>

  6. #476
    Sencha User
    Join Date
    Sep 2014
    Posts
    3
    Vote Rating
    0
    ajay_kango is on a distinguished road

      0  

    Default Problem specific to Tomcat 8.0

    Problem specific to Tomcat 8.0


    Hi ,

    I tried deploying the war on tomcat 7.0 and in that case things worked perfectly.
    Is there some compatibility issue for directjngine with tomcat 8 ? Has anyone faced this issue before?

  7. #477
    Sencha User
    Join Date
    Apr 2010
    Posts
    2
    Vote Rating
    0
    brainformance is on a distinguished road

      0  

    Default


    Hey,

    we found some major issues in the djn 2.3 including
    - multitreading issues
    - api.js generation on Wildfly 8
    - the known sencha architekt bug

    we would like to fix those but for this version there is no source code available. Would it be possible to get the source so we can continue using djn?

  8. #478
    Sencha User
    Join Date
    Sep 2014
    Posts
    3
    Vote Rating
    0
    ajay_kango is on a distinguished road

      0  

    Default Security Issue handling in directJngine

    Security Issue handling in directJngine


    Hi,

    Can anyone please give me some idea about how security issues are handled by DirectJNgine? I have used DWR before which had some handling for XSS and CSRF issues. Are there some ways provided for directJNgine as well which will take care of such problems?

  9. #479
    Sencha Premium Member
    Join Date
    Jul 2007
    Location
    Sydney, Australia
    Posts
    232
    Vote Rating
    140
    seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all seade is a name known to all

      0  

    Default


    Quote Originally Posted by brainformance View Post
    Hey,

    we found some major issues in the djn 2.3 including
    - multitreading issues
    - api.js generation on Wildfly 8
    - the known sencha architekt bug

    we would like to fix those but for this version there is no source code available. Would it be possible to get the source so we can continue using djn?
    The most recent version where source is available is 2.2. It would appear that the author walked away from the code after posting the 2.3b1 jars; it may be time to consider a fork based on 2.2.

    If my backend was using Spring I would be looking at https://github.com/ralscha/extdirectspring which appears to be the only Java based Ext Direct implementation that is actually being maintained.

    The fact that there is not an officially supported Ext Direct implementation in Java is kind of surprising. It actually seems like Ext Direct has stalled in favour of other approaches. This is a shame because the way it batches up requests automatically is really helpful.

  10. #480
    Sencha User
    Join Date
    Apr 2010
    Posts
    2
    Vote Rating
    0
    brainformance is on a distinguished road

      0  

    Default


    Thank you for your response,unfortunetly we are not using spring and other java implementations seem a little unstable to me. We used 2.3 because of its CDI feature (which we had to rewrite anyway) so forking 2.2 may be a good idea.thank you.

Thread Participants: 88

  1. Animal (5 Posts)
  2. barton (4 Posts)
  3. Condor (1 Post)
  4. mauro_monti (6 Posts)
  5. mbarto (1 Post)
  6. aconran (1 Post)
  7. MoShAn480 (1 Post)
  8. asgillett (2 Posts)
  9. seade (6 Posts)
  10. zaqwsxqwer (3 Posts)
  11. Sesshomurai (16 Posts)
  12. ThierryC (3 Posts)
  13. maxm165 (3 Posts)
  14. techstudios (2 Posts)
  15. sayonara (2 Posts)
  16. kschlaudt (1 Post)
  17. hschaefer123 (2 Posts)
  18. omarc (2 Posts)
  19. lxbzmy (4 Posts)
  20. mct (6 Posts)
  21. mediacept (2 Posts)
  22. dionisexorcius (1 Post)
  23. alper (1 Post)
  24. steverc (2 Posts)
  25. chrizmaster (18 Posts)
  26. J@y (21 Posts)
  27. Georgioa (6 Posts)
  28. wguan (1 Post)
  29. minneyar (16 Posts)
  30. jhoweaa (1 Post)
  31. Ramez (2 Posts)
  32. malus (1 Post)
  33. dweller (8 Posts)
  34. stdunbar (1 Post)
  35. vlagorce (20 Posts)
  36. cwilliso (1 Post)
  37. Whatty (13 Posts)
  38. Ice (1 Post)
  39. clynnh (1 Post)
  40. SreevaniN (1 Post)
  41. Stsalomon90 (1 Post)
  42. GregT (9 Posts)
  43. jcalfee (6 Posts)
  44. set_ti (1 Post)
  45. maho2nd (3 Posts)
  46. dreamtaotao (3 Posts)
  47. Toxa (4 Posts)
  48. tungchau (3 Posts)
  49. wlan0 (2 Posts)
  50. jpr (2 Posts)
  51. gianmarco (5 Posts)
  52. extjslikeit (2 Posts)
  53. harmen_wessels (1 Post)
  54. Olivercomputing2 (4 Posts)
  55. brainformance (2 Posts)
  56. vanessa_ng (2 Posts)
  57. alois.cochard (5 Posts)
  58. kyrillos52 (2 Posts)
  59. Tod (1 Post)
  60. Alinanila (1 Post)
  61. tfannon (2 Posts)
  62. Kynao (1 Post)
  63. feiq (4 Posts)
  64. dalt (1 Post)
  65. xfolch (1 Post)
  66. avijit (1 Post)
  67. marcelsnews (2 Posts)
  68. maddhippy (1 Post)
  69. sritter (1 Post)
  70. july (2 Posts)
  71. jtkeller7983 (1 Post)
  72. lfranchini (2 Posts)
  73. 7/11 (2 Posts)
  74. yAdEs (1 Post)
  75. zazz (1 Post)
  76. waqar (5 Posts)
  77. pjain11 (1 Post)
  78. alexMobimesh (2 Posts)
  79. zachHurt (4 Posts)
  80. n0n3 (5 Posts)
  81. adavis2 (1 Post)
  82. mark.peters (1 Post)
  83. lee el (4 Posts)
  84. frengo19 (3 Posts)
  85. prakashwagle (1 Post)
  86. extejnar (2 Posts)
  87. alin@sonatype.com (1 Post)
  88. ajay_kango (3 Posts)