The jar package imported by the JavaWeb project cannot be used

Two cases of lib package placement:

  1. The jar package used will be put into a folder -> lib directory separately, and the lib file and the src file belong to the same level file.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-qURseYc0-1660649588594)(D:\Typora\image-20220816192351803.png)]

  1. Put it under the web–WEB-INF file

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-43IYd5fN-1660649588598)(D:\Typora\image-20220816192640193.png)]

After the jar package is imported, right-click the jar package and select Add to Library – Module Library

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-JhFxgtwD-1660649588599)(D:\Typora\image-20220816193224944.png)]
insert image description here

The second is recommended for the two cases, because in the first case, the lib has been loaded before the web file is loaded, and some packages may not be used in the web page, of course there are solutions –> this solves
insert image description here
javaweb The case where the jar package is imported but cannot be used

Guess you like

Origin blog.csdn.net/Chen__sir__/article/details/126372902