Announcement Announcement Module
Collapse
No announcement yet.
Spring pro MVC with Webflow In Windows ??????? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring pro MVC with Webflow In Windows ???????

    Hi,
    I am looking to learn Spring MVC, I bought this book :
    Spring pro MVC with Webflow

    but it looks like it show only Unix , for example in page 8 :
    the command line : ./gradlew
    does not do anything in windows, so I downloaded gradle ins windows, but there is no gradlew command in gradle , and even the gradle script that come with source code does not do anything.

    Please I apprecite if you can help.
    thanks

  • #2
    It should work without problems on windows (I was on Mac my co-author on Windows). If you are in the correct directory the gradlew.bat file should execute and download gradle (we use the gradle wrapper as explained in the first chapter). The path is indeed in unix but chancing ./ to .\ or remove it should make it work. (We assumed that a developer would be able determine the path differences ).
    Last edited by Marten Deinum; Dec 6th, 2012, 09:26 AM. Reason: Fixed typo.

    Comment


    • #3
      I just moved gradlew.bat to the first chapter , here is what I got :

      C:\maj\books\spring\Apress.Pro.Spring.MVC.Jun.2012 \pro-spring-mvc-code\chapter1-
      bookstore>gradlew
      Exception in thread "main" java.lang.NoClassDefFoundError: org/gradle/wrapper/Gr
      adleWrapperMain
      Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMai
      n
      at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
      Could not find the main class: org.gradle.wrapper.GradleWrapperMain. Program wi
      ll exit.


      Thanks

      Comment


      • #4
        The gradlew.bat and gradlew files are in the root directory... You shouldn't copy those or add them to your path. Simply execute ..\gradlew in your specific directory. If you are in the root execute .\gradlew (or without the .\).

        This is BTW all explained in chapter 1 (just right above image 1-13).
        Last edited by Marten Deinum; Dec 10th, 2012, 08:56 AM.

        Comment


        • #5
          Thank you Marten, it's working now.
          it generated the war file , I put it in Tomcat 7, it worked, I can see the first page that says :

          How exciting! Our first bookstore page!

          The model says Spring says HI!

          My question now, why there is no web.xml in :
          C:\apache-tomcat-7.0.33\webapps\chapter1-bookstore\WEB-INF
          and the application is still working ?
          thanks

          Comment


          • #6
            My question now, why there is no web.xml in :
            C:\apache-tomcat-7.0.33\webapps\chapter1-bookstore\WEB-INF
            and the application is still working ?
            Please read the book it is explained in there (in the introduction/chapter 1). But in short in JEE6 you don't need a web.xml you can use java code/annotations all the way.

            Comment

            Working...
            X