Results 1 to 3 of 3

Thread: DWR 3.0 and Spring 3.0 (using roo)

  1. #1
    Join Date
    Dec 2007
    Location
    Stockholm, Sweden
    Posts
    190

    Default DWR 3.0 and Spring 3.0 (using roo)

    Hello all,

    I just used spring roo to come up with a sample application (which stores an entity with GPS coordinates). I was looking into integrating Google Maps with the application.

    Since it is rather easy to expose your POJO methods as JavaScript using DWR and use them with other javascript stuff (like GMaps, I have done some thing similar before in an application already setup with DWR and Spring 2.5 some time back) I thought I give Spring 3.0 and DWR 3.0 a try.

    I have searched for a concrete example but there is none using the version numbers I am interested in

    I used this link in the beginning
    http://www.codercorp.com/blog/spring...notations.html

    and then looked up and found
    http://www.butterdev.com/category/dwr/

    The problem is that the current setup (which is good enough as far as I am concerned) uses aspectJ to auto generate stuff which I was used to in service and dao layers. So I am not sure how to use annotations in this scheme (where does @Service come, if there should be one?)

    I plan on paying more attention to generated code later, but for now I just needed to do a small prototype Maps application

    Alternatively you can suggest other ways to easily integrated GMaps (with dynamic content, two way, i.e. retrieval and saving of data on a map)

    --
    Hatim
    Shahzada Hatim
    @geoaxis/twitter
    http://hatimonline.com

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    You're able to create any .java class you like and annotate it with @Service and expose it with DWR in the standard way. While Roo can scaffold a web controller for you, this is optional and you are of course always free to write code in any class that you like. So my advice would be to create a new .java source file in your project, pop an @Service annotation onto it and then use DWR as per the tutorials.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3
    Join Date
    Dec 2007
    Location
    Stockholm, Sweden
    Posts
    190

    Default

    Quote Originally Posted by Ben Alex View Post
    You're able to create any .java class you like and annotate it with @Service and expose it with DWR in the standard way. While Roo can scaffold a web controller for you, this is optional and you are of course always free to write code in any class that you like. So my advice would be to create a new .java source file in your project, pop an @Service annotation onto it and then use DWR as per the tutorials.
    So does this mean that it is not possible to expose the methods generated in Node_Roo_Entity.aj?


    After reading some more, I see that coming up with a RESTful webservice using JSON is rather easy to do, Do you think its a better way of working with APIs which only have a dominent JS API base (like Google Maps)
    Shahzada Hatim
    @geoaxis/twitter
    http://hatimonline.com

Tags for this Thread

Posting Permissions

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