Results 1 to 6 of 6

Thread: Spring pro MVC with Webflow In Windows ???????

  1. #1
    Join Date
    Apr 2005
    Posts
    19

    Question 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    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 at 09:26 AM. Reason: Fixed typo.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Apr 2005
    Posts
    19

    Default

    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

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    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 at 08:56 AM.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Apr 2005
    Posts
    19

    Default

    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

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

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