我們先來看項目這樣一個應用
我們在index.jsp中想要引入scripts,css包中的檔案,怎麼辦,為了避免複雜的相對路徑,公司一般采用絕對路徑,來看代碼:
<link rel='stylesheet' href='${pagecontext.request.contextpath }/css/index.css' />
<script src='${pagecontext.request.contextpath }/scripts/utility.js'
type='text/javascript'></script>
簡單吧。