Web container sẽ process/load thư mục classes, lib, và file web.xml trong WEB-INF theo trình tự nào?

Như tiêu đề, tui có tìm hiểu về quá trình container deploy tập tin .war ở phần Class Loader HOW-TO có thể tóm gọn lại như sau:

Therefore, from the perspective of a web application, class or resource loading looks in the following repositories, in this order:

  • Bootstrap classes of your JVM
  • /WEB-INF/classes of your web application
  • /WEB-INF/lib/.jar* of your web application
  • System class loader classes (described above)
  • Common class loader classes (described above)

If the web application class loader is configured with <Loader delegate="true"/> then the order becomes:

  • Bootstrap classes of your JVM
  • System class loader classes (described above)
  • Common class loader classes (described above)
  • /WEB-INF/classes of your web application
  • /WEB-INF/lib/.jar* of your web application

Tui cũng đọc ở Deployment nhưng không hề nói rõ về rõ thứ tự load file web.xml trong thư mục WEB-INF.
Tui chỉ đoán rằng container sẽ đọc đến nó sau cùng để mapping, khởi tạo tham số,… tuy nhiên đây chỉ là suy đoán.
Mong được giải đáp.

1 Like
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?