Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Support for Grails/Spring Boot?

    I'm playing around with combining different technologies for a new project, and I thought I'd explore ways to use Smartclient within Spring Boot or Grails 3 (which is based on Spring Boot) and I want to use your SQLDataSource.

    However, I can't figure out how to get web.xml supported. The documentation here http://docs.grails.org/3.2.x/guide/u...#upgradingApps this seems to say I can just put (basically) everything from smartclientRuntime into src/main/webapp and it'll find my web.xml, however, that doesn’t seem to be working for me (Smartclient gives me a popup saying the DataSourceLoader servlet is not installed). I don’t know yet whether something is misconfigured or if this can’t work. The documentation here https://docs.spring.io/spring-boot/d...to-spring-boot indicates that the way to convert is through source code (i.e., the @Bean annotation), however, it’s unclear to me whether converting web.xml is necessarily or only recommended. One way or another, it looks like this integration could work although it’s unclear to me what’s my easiest approach.

    Do you currently support Spring Boot / Grails (the documentation of yours that I found didn’t seem entirely relevant) or have any advice about how to integrate them?

    #2
    For what it's worth, I've tried many things but I can't get either Grails or pure Spring Boot to read Smartclient's web.xml. In grails3, I did get this to work:

    Code:
     > cat grails-app/conf/spring/resources.groovy
    import org.springframework.boot.web.servlet.ServletRegistrationBean
    import org.springframework.boot.web.servlet.ServletListenerRegistrationBean
    
    // Place your Spring DSL code here
    beans = {
    /*
        iscInitListener(ServletListenerRegistrationBean) { bean ->
             listener = new com.isomorphic.base.InitListener()
        }
        iscInit(ServletRegistrationBean) { bean ->
             servlet = new com.isomorphic.base.Init()
             loadOnStartup = 1
        }
    */
    
        IDACall(ServletRegistrationBean) { bean ->
             servlet = new com.isomorphic.servlet.IDACall()
             urlMappings = ['/isomorphic/IDACall/*',
                            '/isomorphic/IDACall.aspx/*']
        }
        DataSourceLoader(ServletRegistrationBean) { bean ->
             servlet = new com.isomorphic.servlet.DataSourceLoader()
             urlMappings = ['/isomorphic/DataSourceLoader']
        }   
    }
    I commented out the init stuff because leaving it in was causing every URL to get a 405 error (and commenting it out seemed to let my simple test html page load a Smartclient SQLDataSource+ListGrid). Maybe I'll run into other issues down the road, but this is a promising start.

    I'm still a bit hesitant to plunge into re-writing all of your web.xml, but maybe I could just take that on as-needed...

    Comment


      #3
      We haven't looked into getting Grails 3 integration to work. We agree, the documentation you've found seems to indicate your approach should work, but then goes on to say transforming web.xml in the way you are doing seems to be required.

      What are you hoping to get from this integration? You've indicated you want to use SQLDataSource, and you can already write Groovy code for DMI logic (via the Server Script system). So what are the compelling features you hope to get?

      Comment


        #4
        Maybe my lack of experience in server-side technologies makes it hard for me to read behind the lines, but I see phrases like "you may need" or "it is still possible" which leave me guessing what's necessary and what's ideal.

        I'm treating these as requirements for my prototype:
        1. SQLDataSource (seems best/only way to get that is a Java framework)
        2. create-react-app ecosystem integrated into build (grails 3 provides that)
        3. Smartclient UI
        4. a gradle build system to tie it all together in one deployment (another technology I'm exploring for this based on its usage elsewhere in my group)
        5. Easy way to build my own REST services (not CRUD-like and which could be sophisticated) and grails seems like the easiest option in the Java world

        It seems like there are many ways to accomplish this, but grails3+their react profile+Smartclient gives me a lot out of the box.


        Comment


          #5
          OK, seems like what you're really looking for here is a build system (gradle) and a script that throws together a project template (create-react-app), but getting these things is pulling you into some grails-related requirements (like transforming web.xml) even though you have no plans to use Grails / Groovy per se?

          Comment


            #6
            Yes, that would capture the most important features I'm looking for. Probably not too hard to put that together.

            However, with something like this in mind (for whatever it's worth):

            https://insights.stackoverflow.com/t...2Cgwt%2Cvaadin

            it would be nice to join the Spring Boot parade, too, as a way to anticipate server side features I may be interested in down the road. Since I'm not an expert in Java server side stuff, I really want to stay close to stackoverflow popularity for its answers. I've focused on Grails since that's what I'm already familiar with from another project (and it's based on Spring Boot).

            Comment

            Working...
            X