在每个jsp页面中包含css和js文件 [英] Include css and js file in every jsp page

查看:164
本文介绍了在每个jsp页面中包含css和js文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有每个jsp文件中包含的常见css和js文件。

I have common css and js files that i include in every jsp file.

那么在每个页面中包含它们的最佳做法是什么?

So what's the best practice to include them in every page ?

我以前使用<%@ include file =header.jsp%> 但是我我想知道这是否是最好和最干净的方式。

I used to use <%@ include file="header.jsp" %> but I'm wondering if this is the best and clean way to proceed.

推荐答案

最好的解决方案是使用JSP标记文件。
它允许使用标记文件封装可重用内容: Java doc参考

The best solutions is to use JSP Tag File. It allows to encapsulate reusable content using Tag Files : Java doc ref

这是一个很好的答案,例如: https: //stackoverflow.com/a/3257426/1140748

Here is a good answer with example : https://stackoverflow.com/a/3257426/1140748

这篇关于在每个jsp页面中包含css和js文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆