The current project is using MAVEN to manage the jar package, which is the first time I've touched Maven, it feels great, I don't have to add and download the jar package again, and I can configure it directly in the MAVEN configuration file, and maven can help us download it automatically. Very convenient. Before the busy time to tidy up, now tidy up, record down, deepen the impression. Of course we use MAVEN just the most basic, many other features are not used, This article only describes how to create a MAVEN project, do nothing else .
The following recommended 2 maven find the jar configuration of the site, only need to search for keywords to find the required jar package, very convenient, such as: MySQL can find Mysql-connect-java.jar.
http://search.maven.org/#search%7cga%7c1%7cmybatis
http://mvnrepository.com/
The following is a guide to creating a related graphic:
1, first create a new MAVEN project, look at the picture:
2, follow the above steps can create a MAVEN project, you can see the most directory structure, but such a directory structure is wrong , need to make some changes.
First in order to avoid garbled, we should change the project code to UTF-8, after the project code is used UTF-8, add a character encoding filter, garbled no longer "chaotic" (not to say no, but easier to solve).
Again, follow the operation with the solution (set JRE as the default), so that the complete and correct directory structure will appear, for what reason, I am not very clear, should be a bug:
Finally, there is a index.jsp error, we need to introduce the Java EE jar package. Introduced in Pom.xml:
<!--import Java EE jar package--><dependency><groupid>javax</groupid><artifactid>javaee-api </artifactId><version>7.0</version></dependency>
At this point, the complete directory structure and the correct project are done. Then some configuration, after all, is a Web project, need jstl and so on, configured as follows:
(Reprint annotated source, original address: Http://blog.csdn.net/zhshulin)