12/18/2023 0 Comments Spring annotations example mvc![]() ![]() The hello method return an string with the "hello" value, as we did the configuration of the InternalResourceViewResolver, the Spring will search an file with name "hello.jsp" in the folder that we configured in the resolver. Te URL " it can be a diferent path depending of your Tomcat configuration. This controller listen to a route to the root ("/") of the application, so this method will be called when we do the request to With this we can start to configure our Spring MVC configuration with annotations, to start let's create the class SpringConfig on the package "me.", as the following: package me. import .ComponentScan import .Configuration ( basePackages = See the necessary dependencies in the following section: rvlet rvlet-api 3.1.0 provided rvlet jstl 1.2 org.springframework spring-webmvc 4.3.4.RELEASE With the project created, let's put the necessary dependencies on pom.xml, with those dependencies we will be able to run our Spring MVC project. In the next window, we will fill the Group Id with the value "me.efraimgentil", the Artifact Id with "spring-annotation-example" and to finish the Packaging field select "War" and click in "Finish". Now on the create project window, select the option "Create a simple project ( skip archetype selection )" and click on "Next". Let's begin creating a Maven project, use the short cut "Alt + Shift + N" and select Maven Project or select the menu File > New > Maven Project. I'm also using Eclipse ( Luna version ) as the IDE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |