f455176715 2015-07-16 04:57 采纳率: 62.5%
浏览 4362
已采纳

如何把jsp页面头部中那些加载css、js的命令提取出来放在一个jsp页面里

是这样的我要做好几个jsp页面,都使用bootstrap作为前端框架

于是在每个jsp页面的 head>中都有这么一大段加载命令:

     <link href="css/charisma-app.css" rel="stylesheet">
    <link href='bower_components/fullcalendar/dist/fullcalendar.css' rel='stylesheet'>
    <link href='bower_components/fullcalendar/dist/fullcalendar.print.css' rel='stylesheet' media='print'>
    <link href='resources/bower_components/chosen/chosen.min.css' rel='stylesheet'>
    <link href='bower_components/colorbox/example3/colorbox.css' rel='stylesheet'>
    <link href='bower_components/responsive-tables/responsive-tables.css' rel='stylesheet'>
    <link href='bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css' rel='stylesheet'>
    <link href='css/jquery.noty.css' rel='stylesheet'>
    <link href='css/noty_theme_default.css' rel='stylesheet'>
    <link href='css/elfinder.min.css' rel='stylesheet'>
    <link href='css/elfinder.theme.css' rel='stylesheet'>
    <link href='jquery.iphone.toggle.css' rel='stylesheet'>
    <link href='uploadify.css' rel='stylesheet'>
    <link href='css/animate.min.css' rel='stylesheet'>

这样修改起来不方便,如果把这些相同的标签都单独列出来放在一个jsp页面中就会好很多。

我应该怎样做,新建的这个jsp页面要声明什么吗,其他引用该页面的jsp要声明什么,就是如何把它们联系起来

  • 写回答

3条回答

  • danielinbiti 2015-07-16 05:01
    关注
    把公共的提取出来,放到common.jsp中,通过@include的方式引入其他页面
     <%@include file="common.jsp" %>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog