1. Create a new Maven Web project using Netbeans IDE. (Version used for this post is 7.3 beta3)
2. Run through the wizard to create the Maven Web Application. here i have given the name "CFXSpring" as the project name.
3. In the next screen of the wizard select the server of your choice. Here i have selected Glassfish server which comes bundled with Netbeans.
4. Then click on finish, your project is ready to use. Here you can notice the following folder structure is created by Maven for you.
5. Now its time to add Spring MVC Framework to our application. So right click on the project node in project window and go to properties menu item. IDE will pop up a properties window for you. In that window go to "Frameworks" categories. In the right panel of the window you will get a empty text area with an "Add" button to its right. Just Click on the Add button.Another framework window will pop up with the list of frameworks works available to choose from. Select Spring Web MVC from that window. See the screen shot below for clarity.
6. Now select the Spring Framework version you like to use with this application. Here i have selected 2.5.6 to use with my application. see the figure below.
7. Once the above step is done. Spring frame work will be added to the project by the IDE, by including the needed dependencies to the POM.XML file. By the way adding the dependencies to the project dependencies folder. see the figure below.
8. Now you can see there is a change in the project folder structure also. A new folder "WEB-INF" is added to the project. That folder will also contain "applicationContext.xml" which is nothing but the Spring Configuration file where we will be wiring our beans and bean dependencies through property or constrructer injection. also you can see "web.xml" which is nothing but the web applications deployment descriptor.
9. In "web.xml" you can see already "org.springframework.web.servlet.DispatcherServlet" is configured for you by the IDE. so no need for us to do any extra configuration with respect to spring.
10. Now its time to add CFX dependencies to POM.XML. This we will do manually with out using any of the IDE's wizards.
11. Open the "pom.xml" file which will be located in the projectfiles folder of the project.
12. Go to "dependencies" tag. and add the following dependency to it.