springmvc

0915)

1)spring中的p命名空間和c命名空間

推薦鏈接:https://blog.csdn.net/lianjiww/article/details/54031386

2)三種代理方式

推薦鏈接:https://segmentfault.com/a/1190000011291179

3)AOP理解

推薦鏈接:https://zhuanlan.zhihu.com/p/24565766

4)AspectJ的理解

推薦鏈接:https://juejin.im/entry/5a40abb16fb9a0451e400886

5)spring的@autowired爲什麼注入的是接口

推薦鏈接:https://blog.csdn.net/weixin_30839881/article/details/96735844

6)spring中DAO中繼承JdbcDaoSupport與不繼承的套路

推薦鏈接:https://blog.csdn.net/llussize/article/details/79444104

7)在servlet中獲取項目路徑

  1. this.getServletConfig().getServletContext().getRealPath("/");

  2. 根目錄所對應的絕對路徑:request.getServletPath();

  3. 文件的絕對路徑 request.getSession().getServletContext().getRealPath(request.getRequestURI())

  4. 當前web應用的絕對路徑 :servletConfig.getServletContext().getRealPath("/");

  5. ServletContext對象獲得幾種方式: Javax.servlet.http.HttpSession.getServletContext()

    Javax.servlet.jsp.PageContext.getServletContext()

    Javax.servlet.ServletConfig.getServletContext()

    1. 文件的絕對路徑 :request.getSession().getServletContext().getRealPath(request.getRequestURI())
    2. 當前web應用的絕對路徑 :servletConfig.getServletContext().getRealPath("/");

8)session的創建

獲取session:
因爲session是由服務器自動管理的,因此session的獲取不可以直接new,而是要通過request或者servletcontext的方法獲得,一般是:
HttpSession session=request.getSession();
這樣就拿到session了。我們知道不同的客戶端有自己的session,這個沒有影響,只要通過上面的方法我們就可以獲取到當前訪問的request的session

9)SpringMVC中MultipartResolver 獲取文件內容爲空問題

原文鏈接:https://www.jianshu.com/p/f31fc9b90d1b

原文鏈接:https://blog.csdn.net/smithallenyu/article/details/80515296

10)item.getName()

遊覽器有些名字的獲取會存在問題

  /**
     * Returns the original filename in the client's filesystem, as provided by
     * the browser (or other client software). In most cases, this will be the
     * base file name, without path information. However, some clients, such as
     * the Opera browser, do include path information.
     *
     * @return The original filename in the client's filesystem.
     * @throws InvalidFileNameException The file name contains a NUL character,
     *   which might be an indicator of a security attack. If you intend to
     *   use the file name anyways, catch the exception and use
     *   InvalidFileNameException#getName().
     */
    String getName();

11)攔截器和過濾器的區別

過濾器是 servlet 規範中的一部分,任何 java web 工程都可以使用。

攔截器是 SpringMVC 框架自己的,只有使用了 SpringMVC 框架的工程才能用。

過濾器在 url-pattern 中配置了**/***之後,可以對所有要訪問的資源攔截。

攔截器它是隻會攔截訪問的控制器方法,如果訪問的是 jsp,html,css,image 或者 js 是不會進行攔

截的。

它也是 AOP 思想的具體應用。

我們要想自定義攔截器, 要求必須實現:HandlerInterceptor 接口

12)jdk1.8接口

在springmvc的攔截器中體現

13)mysql的數據類型double

double(16,2) 16位長度,小數點後2位

14)servlet-api

servlet.jar 是servlet 3.0 版本之前的地址
javax.servlet-api.jar 是servlet 3.0 版本之後的地址

[外鏈圖片轉存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳(img-jChj6x8k-1569754943235)(C:\Users\15566\AppData\Roaming\Typora\typora-user-images\1569693596818.png)]

15)日誌介紹

https://my.oschina.net/pingpangkuangmo/blog/410224

16)junit5學習

推薦原文:https://blog.csdn.net/ryo1060732496/article/details/80792246

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章