Related to the MOOC seckill project

Project address https://github.com/MRGCODING/seckill-ssm

Project Summary https://www.imooc.com/article/11925

1. Version 5.7.20 or above is required when building a database, otherwise a TIME_XXX error will be reported, and the Git source code is InnoDB

2. There is an error in the source code on Git. Date is used to get the time from the database, and LocalDateTime will appear null

3.https://blog.csdn.net/hipilee/article/details/78797473

4. The difference between ContextLoaderListener and DispatcherServlet configuration contextConfiguration

https://bbs.csdn.net/topics/391076893?page=1, that is, starting from servlet 3.0, there is no need to configure ContextLoaderListener

Scan applicationContext-*.xml in DispatcherServlet.

5. Regarding the problem that static resources cannot be loaded after the web.xml configuration mapping "/", there are three solutions.

1) Modify web.xml so that all requests ending with action enter SpringMVC

    <servlet-mapping>

       <servlet-name>boot-crm</servlet-name>

       <!-- All requests enter springMVC -->

       < url-pattern>*.action</url-pattern>

    </servlet-mapping>

2) Configure in springmvc.xml

    <!-- Solve the problem that static resources cannot be processed by springMVC-->

   <mvc:resources location=" /WEB-INF/js/" mapping="/js/**"/>
    <mvc:resources location="/WEB-INF/css/" mapping="/css/**"/>

     Modify web.xml, Let all requests go into SpringMVC

    <servlet-mapping>

       <servlet-name>boot-crm</servlet-name>

       <!-- All requests go into springMVC -->

       <url-pattern>/</url-pattern>

3) Configure in springmvc.xml

    <!-- Solve the problem that static resources cannot be processed by springMVC-->

    <mvc:default-servlet-handler />

     Modify web.xml so that all requests ending with action enter SpringMVC

    < servlet-mapping>

       <servlet-name>boot-crm</servlet-name>

       <!-- all requests go to springMVC -->

       <url-pattern>/</url-pattern>

    </servlet-mapping>

The second is recommended . Although it will invalidate the home page configured by web.xml, we will all use the Springmvc Controller mapping, so the default home page is meaningless.

If you want to keep the default home page, you can use the third way, and this way you don't need to show the exact directory structure.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325722294&siteId=291194637