日期:2014-05-17  浏览次数:20622 次

关于myeclipse中访问html的问题???
我把register.html文件放在了WEB-INF下面。为什么这样访问不到呢?如何访问呢???http://localhost:8080/myday06/WEB-INF/register.html      myday06是我的工程名。

如果是下面这样:
http://localhost:8080/myday06/re.html  这样可以访问到re.html        结构图如下:
myeclipse html

------解决方案--------------------
引用:
Quote: 引用:

WEB-INFO里的文件是受保护的,不可以通过url直接访问,在web-info文件外写一个jsp,里添加一个连接指向web-info里的要访问的文件
连接怎么添加呢?能不能写一下?
 <servlet> 
  web.xml下:
<servlet-name>test</servlet-name>
  <jsp-file>/WEB-INF/test.jsp</jsp-file>
 </servlet>
 <servlet-mapping>
  <servlet-name>test</servlet-name>
  <url-pattern>/to_test</url-pattern>
 </servlet-mapping>

然后可以通过
window.open("to_test"); 
就可以跳转了

或者直接:window.open(".../.../.../xxx.jsp");就可以了