Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我正在按照本教程http://www.malsup.com/jquery/block/ 将 jquery 嵌入(Struts2)代码中,但它没有找到库,但是我已将它放在 WebContent/Lib 文件夹中。如果您有任何示例代码,将不胜感激。
假设您有这样的项目结构:
-src | -webapp | -WEB-INF | -pages | -css | -js | -blockUI.js | ...
你可以这样做:
<html> <head> <script src="${pageContext.request.contextPath}/js/blockUI.js"/> </head> <body></body> </html>
${pageContext.request.contextPath}表示内容路径。
${pageContext.request.contextPath}