问题 不同页面使用同一个导航栏,如果每一次都写一遍,很麻烦。参考vue中的路由,实现组件复用。 解决 <%@include file="header.jsp" %> 其中header.jsp就是导航栏: 主页index.jsp代码: 测试