Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Ext on Java ??

  1. #1
    Sencha User chalu's Avatar
    Join Date
    Feb 2008
    Location
    Benin City, Nigeria
    Posts
    480

    Question Ext on Java ??

    I am planning to build my first real Ext App, and I have been seriously considering using Java (instead of PHP) for the backend because of the requirements. My experience (experimantaly)
    with Ext has always been with PHP e.g :

    Code:
    <?php
    
      $response = array(
         'success' => true,
         'message' => 'Completed Update Request',
         'data' => array(1, 2, 3, 4, 5, 6, 7, 8, 9)
      );
    
      print json_encode($response);
    
    ?>
    I am wondering what it is like if I was to do something like this in Java. I am thinking of using Spring + Hibernate + JBoss. Would it be possible without DWR

    What are your experiences / other things I need to know

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Yes, that's quite easy. You just need a JSON library which can encode beans, and Java.util.* classes into JSON.

  3. #3
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Ext is platform independent.


    We manually write our actions. But you can use Ext Direct to take care of many of that stuff automagically.

    DWR is awesome to use with java btw.

  4. #4
    Sencha User chalu's Avatar
    Join Date
    Feb 2008
    Location
    Benin City, Nigeria
    Posts
    480

    Question

    Yeah DWR is beginning to sound interesting to me, still looking at it though, but some articles are mentioning things like 'generating javascript' and I really don't like technologies / tools that interfere .

    Another question, would you guys recommend Netbeans or Eclipse for development of a Java based Ext application. Netbeans has some good javascript support but I hear a lot of noise about Eclipse

  5. #5
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Eclipse is awesome. I don't personally use it. I started using intellij and have fallen in lovewith it.

    I'm just starting to learn java, so i'm no guru. AutoComplete is awesome in all 3 of those IDEs. You can get an aptana plugin for eclipse btw, for full Ext and javascript support.

  6. #6
    Sencha User chalu's Avatar
    Join Date
    Feb 2008
    Location
    Benin City, Nigeria
    Posts
    480

    Thumbs up

    I "left" active Java development early in 2007, so I'm rusty now. Yeah, I use Aptana for Javascript development, but javascript (in web apps) is usually developed as part of a larger project (Java / PHP / ASP.NET etc) and none of them (IDEs) handle javascript well enough like Aptana.

    My experience had been to use Zend studio for Eclipse for the server-side (PHP) and then Aptana for the client-side (HTML, CSS, Javascript) but since I usually developed against a local SVN repository I had to create working copies (2) for each project, one for the PHP development with Zend Studio and the other with Aptana for the client side technologies.

    I don't want to do this again, I need a better way. Yes Netbeans has good support for Javascript but it adds to your project, a copy of every API you are using to script the application, unlike Aptana that just uses a global script library reference for autocompletion.

    I am persuaded to use Eclipse. I was wondering, is there a way to install Aptana as a plugin to Eclipse and use Aptana's scripting features in a JavaEE project by switching perspectives ?? tried it but could only enjoy the Aptana JS features when I create an Aptana related project.

    Thanks.

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    DWR generates stub functions dynamically in order to export an interface into the browser.

    So you annotate a class to export methods.

    Then you include a <script> in your page which pulls in a generated class from the DWR servlet. This javascript is generated on demand according to the definition and annotatinos in that class.

    Then you can just call methods of that class.

    Of course they don't return data, you append a callback function which receives any return value.

  8. #8
    Ext JS Premium Member tim.sporcic's Avatar
    Join Date
    May 2008
    Location
    Plano, TX
    Posts
    38

    Default

    There are multiple ways of using ExtJS with a Java backend. Some swear by DWR. My own experiences with it have been less then positive. I've ended up pulling it out of the last two projects and replacing with Spring Framework controllers returning straight JSON data. It was a better match for ExtJS. You can check out my sample of using ExtJS with Java/Spring to give you some ideas.

    If you're used to the lighter-weight syntax of PHP, you might also check out Groovy/Grails. You get the full power of the Java VM in a dynamic language.

  9. #9
    Sencha User chalu's Avatar
    Join Date
    Feb 2008
    Location
    Benin City, Nigeria
    Posts
    480

    Question DWR is very interesting

    Really DWR is interesting, I have always tried to have a 'domain' layer (in the client too) in my Ext experimentation so my app can be structurally stronger instead of just having namespaced loose functions and and objects that just make ajax calls and update UI. With DWR I have that leverage of a Person 'domain' object in my client from my server.

    One more question, DWR claims to have 'Reverse Ajax', is this the comet we've been talking about, and how does this intgrate with the Ext.direct that I hear of.

    Thanks very much.

  10. #10
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Reverse Ajax allows threads running in your server to execute methods in browser sessions.

    DWR handles in this either through regular polling of the server, or by pigggybacking the requests for any new reverse Ajax calls on packets which are being sent to make regular DWR calls.

    We have experimented with reverse Ajax for things like broadcasting messages to logged in users, and it works well.

    Obviously standard JEE sessions don't time out when being polled repeatedly, so you will have to come up with another way of detecting a "dead" session.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •