<@ include file="xxx.html">
可以的,这个使用相对路劲

解决方案 »

  1.   


    文件目录如上,我在js里面 <%@ include file="../../../../../../../xxx.html" >   因为在项目中路径错误会红叉所以我一直向上,直到项目外的目录,但还是500错误,找不到加载的html
      

  2.   


    我设置了路径  jsp没报错,说明已经到了项目路径,与项目平行了,文件也放在项目平行位置,为什么还是找不到
      

  3.   


    项目要include文件 的绝对位置  
    C:\Documents and Settings\Sean Guo\Documents\workspace\project\src\main\webapp\WEB-INF\views\Manage\index.jsp被include文件的绝对位置C:\Documents and Settings\Sean Guo\Documents\workspace\123.html
    project是项目名字
      

  4.   


    不是,项目以外,和它平行目录
    如项目 c:/project   ,文件c:/123.html
      

  5.   

    再网上2级看下
    项目要include文件 的绝对位置  
    C:\Documents and Settings\Sean Guo\Documents\workspace\project\src\main\webapp\WEB-INF\views\Manage\index.jsp被include文件的绝对位置C:\Documents and Settings\Sean Guo\Documents\workspace\123.html
    project是项目名字
      

  6.   


    是的最好用绝对路径。
    http://www.avajava.com/tutorials/lessons/how-do-i-import-content-from-another-site-into-my-jsp.html?page=2
      

  7.   


    是的最好用绝对路径。
    http://www.avajava.com/tutorials/lessons/how-do-i-import-content-from-another-site-into-my-jsp.html?page=2我在想,服务器只加载了项目,没有加载这个html,根据相对路径能找到这个html吗,怎么让这个html也被服务器加载呢
      

  8.   


    我在想,服务器只加载了项目,没有加载这个html,根据相对路径能找到这个html吗,怎么让这个html也被服务器加载呢
      

  9.   


    我在想,服务器只加载了项目,没有加载这个html,根据相对路径能找到这个html吗,怎么让这个html也被服务器加载呢我觉得简单点,你想办法把这个文件copy到你的项目中,你可以在程序启动的时候用流把html文件copy到你工程下
      

  10.   


    我在想,服务器只加载了项目,没有加载这个html,根据相对路径能找到这个html吗,怎么让这个html也被服务器加载呢我觉得简单点,你想办法把这个文件copy到你的项目中,你可以在程序启动的时候用流把html文件copy到你工程下
    我也是觉得啊,但是这个文件是许多项目公用的,都用一个比较好点