IDEA project to create a Springmvc

This is indeed toss a half at the beginning of learning Springmvc.

 

First direct choose to create a simple web project

 

 

 Why not check Springmvc? A: If there is no springmvc jar package can be created once and then extract the idea to automatically download jar package, and then restart the idea to create a common web project.

After checking the spring, it helped lib package and engineering you create a directory, rather than web directory,

Cause, even if you face the controller parsers are written, still will not visit (404)

Proper project structure should be like this

 

 

 lib must be in WEB-INF below ( pit dead). . .

Then write xml in central servlet written

 

 

 And a controller configured ViewRenderer



 

 Note the name of the configuration file. Must be the central controller servlet + "- servlet"

Such as

 

 

 

 

Guess you like

Origin www.cnblogs.com/EEEEC/p/11735777.html