如题。
不要用每个文件去包含。

解决方案 »

  1.   

    <include file> 
    jsp:include  
    静态载入和动态载入都行
      

  2.   

    楼上说的还是包含啊,这样子每个文件都要去加include,不是我想要的。我的意思比如说,我现在有1000个静态html文件,在不修改这些文件的前提下,使得访问这些文件时加上我附加的页脚信息。
      

  3.   

    用frame或者iframe去包含静态的html和你的页脚信息
      

  4.   

    写个 JavaBean 不就行了..以后你再调用
      

  5.   

    在web.xml中对JSP属性进行设置,
        <jsp-config>
            <jsp-property-group>
                <display-name>url</display-name>
                <url-pattern>/manager</url-pattern>
                <page-encoding>UTF-8</page-encoding>
                <include-prelude>header.jsp</include-prelude>
                <include-coda>foot.jsp</include-coda>
                </jsp-property-group>
            </jsp-config>
    其中的url-pattern指定作用的目录,page-encoding指定页面编码,指定页首包含文件,include-coda指定也叫包含文件
      

  6.   

    楼上兄弟的方法我试试.
    关于web.xml的配置,不知道哪里有最详尽的参考资料?
    网上都是些杂碎的,没有见到完整的web.xml参考文档。
      

  7.   

    jsp页面接收一个参数,参数用于制定要读取的静态页面名
    然后jsp中的代码去读取那些html页面,API中有用于解析HTML的方法,解析完了根据你的业务要求分析下,该在什么地方加就加上就是了
      

  8.   

    使用过滤器也可以实现public class MyFilter implements Filter { public void destroy() {
    // TODO Auto-generated method stub } public void doFilter(ServletRequest arg0, ServletResponse arg1,
    FilterChain arg2) throws IOException, ServletException {
    // TODO Auto-generated method stub

    arg2.doFilter(arg0, arg1);

    arg1.getWriter().println("<h1>过滤器加的</h1>");//输入页脚

    } public void init(FilterConfig arg0) throws ServletException {
    // TODO Auto-generated method stub }}web.xml<?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <filter>
    <filter-name>myfilter</filter-name>
    <filter-class>test.MyFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>myfilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping></web-app>