Announcement Announcement Module
Collapse
No announcement yet.
GWT as default for web tier Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GWT as default for web tier

    Hey there, I am very happy about the integration of GWT into Spring Roo. Playing around a little bit, I just wondered if it would be possible to integrate GWT as default into a new project. After running "gwt setup" and "mvn tomcat:run" I would like to have the UI based on GWT. Is this possible?

    Best regards,
    Matthias

  • #2
    If you use "gwt setup" and don't use any of our "controller" commands you will have a GWT based UI (and no traditional request-response MVC based UI). Note that "mvn gwt:run" is the recommended command to load a GWT development server. It means if something changes in your project (eg Roo recreates a file, or you edit one in your IDE/editor) the running browser will update as soon as you hit refresh. "mvn tomcat:run" will, on the other hand, run up a compiled GWT application (not the GWT development mode server).

    Comment


    • #3
      To get the compiled version one must do "mvn package", right? I has stumbled over this when trying the first gwt project because normaly it's possible to run a project with the inplace tomcat or jetty without packaging the application.

      Perhaps this should be checked or at least noted anywhere.

      Comment


      • #4
        Yes, you generally use "mvn package" to cause a compilation of the sources to JavaScript. However, some other goals are available if you'd prefer to use thme: http://mojo.codehaus.org/gwt-maven-p...ugin-info.html

        Comment


        • #5
          So as a consequence the "gwt:" goals have to depend on "mvnackage". Well, I don't know if this inter-mojo-dep is possible but at least good to know :-)

          Comment


          • #6
            Originally posted by Ben Alex View Post
            If you use "gwt setup" and don't use any of our "controller" commands you will have a GWT based UI (and no traditional request-response MVC based UI). Note that "mvn gwt:run" is the recommended command to load a GWT development server. It means if something changes in your project (eg Roo recreates a file, or you edit one in your IDE/editor) the running browser will update as soon as you hit refresh. "mvn tomcat:run" will, on the other hand, run up a compiled GWT application (not the GWT development mode server).
            For me 'mvn gwt:run' works just fine but "mvn tomcat:run" generates an error. I had tried compiling the GWT application using "mvn package" as well as "mvn gwt:compile". Here is the stack trace of the error. Am I missing something?

            Code:
            javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/gwttest/app/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
            	org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:275)
            	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:214)
            	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
            	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
            	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
            	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
            	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
            	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
            	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
            	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            	org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
            	org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
            	org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
            	org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
            	org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
            	org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
            	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
            	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
            	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
            	org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
            	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

            Comment


            • #7
              I am having the similar problem following the GWT Expense demo

              Code:
              javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/gwttest/app/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
              ....
              I followed the steps from the Expense demo, it gets up to a point where I can run mvn gwt:run and the app would starts. But I will get the above error as soon as I try to add an employee.

              Anyone know the "correct" steps to create a working Expense project?

              Thanks in advance.

              Comment

              Working...
              X