each oneMaventhe directory structure of the project is mostly the same, and this directory structure is calledMavenStandard directory structure. BecauseMavenis the contract is better than the configuration, directly generated according to templateWebAppdirectory, so its defaultWebappis its publishing directory. We don't need any moreCopya copywebcontentdirectory, if you duplicate a copywebcontentdirectories that need to bePom.xmlinside configuration, TellMaven.
     &NBSP, based on maven convention is better than configuration, we use its default folder directory, All jsp web -inf springmvc The Returned interface is not found. What is this for?
WEB -inf directory is a protected directory, we put the background JSP The page is placed under its directory to enhance security and protect the source code. This directory is access control permissions, directly in the address bar to enter the page URL address is not accessible, prompting 404 error. You need to configure to access the.
The configuration is as follows:
xmlns:p= "http://www.springframework.org/schema/p" <!--access JSP page add note driver START--><MVC: Annotation-driven/><context:component-scan base-package= "Com.tgb.itoo.basic.controller" ></context: Component-scan><bean id= "Viewresolver" class= " Org.springframework.web.servlet.view.InternalResourceViewResolver " p:prefix="/web-inf/jsp/" p:suffix=" . jsp "/><!--Access JSP page add note driver end-->
the configuration above is configuredSpringmvcView parser. SpringmvcUseViewresolveraccording toControllerreturned in theViewname is associated to the specificViewobject, usingViewobject to render the return value to produce the final view.
Summarize:
JSP page is placed in WEB -inf and the Webapp What are the pros and cons?
put in web -inf The advantages of the directory are more secure, and the resources under it are not directly serviced by the customer and cannot be accessed directly jsp
The advantage of Webapp is that the structure is clear and the JSP page can be accessed directly . You can also add filters to achieve the JSP can not directly access the effect.
Easyui+springmvc--maven Project--web-inf secure Directory Access JSP