New springmvc profile

When creating a new spring or springmvc configuration file, you need to join the spring-bean-4.3.18.RELEASE.jar package, of course, be other versions, so you can in the resource directory, such as the following resources (Resources Root type) catalog New Right -> XML Configuration File select Spring Config only joined the spring-bean-4.3.18.RELEASE.jar package or rely on this option will have the Spring Config

Newly built springmvc springmvc-servlet.xml profile as follows:

There you can see above the yellow warning bar like, you can click Create Spring facet, you can manually in Project Structure ...-> Modules under the name of the selected module, click the + Spring determine selection is complete, then becomes this:

There are yellow stripes like a warning, and then click Configure application context select Create new application context ... completed by default, or manually in Project Structure ...-> Select the newly erected at Modules Spring, click on the bottom of the + sign to New Application Context, fill in the name, springmvc profile such as to write Springmvc Servlet, check the configuration file to determine complete, the yellow bar disappears

What needs to join what constraints need to label, such as <mvc: annotation-driven /> tag will need to be added need mvc mvc constraints:

Another example of context tags and constraints:

 

Guess you like

Origin www.cnblogs.com/yanguobin/p/11622096.html