当前位置: 代码迷 >> J2EE >> 在myeclipse中编写tag文件如何使用tagdir指定tag文件路径
  详细解决方案

在myeclipse中编写tag文件如何使用tagdir指定tag文件路径

热度:18   发布时间:2016-04-22 01:41:28.0
在myeclipse中编写tag文件怎么使用tagdir指定tag文件路径
我在jsp文件中调用了tag文件,将tag文件放在WebRoot/WEB-INF/tags中,我在jsp文件开头用<%@ taglib tagdir="/WEB-INF/tags" prefix="odbc"%>,但是提示我 - Can not find the tag directory "/WEB-INF/tags",我把tagdir改成
"WebRoot/WEB-INF/tags"也不行,下面是我的JSP文件:
Java code
<%@page contentType="text/html;charset=gb2312"%><%@ taglib tagdir="/WEB-INF/tags" prefix="odbc"%><html><body> <odbc:oracle database="ORCL" tablename="goods" username="vendition" password="vendition"/> <br>在表中查询到记录: <br><%=queryResult%></body></html>

我在editplus中是可以用的,但是在myeclipse中用不了。


------解决方案--------------------
这跟用什么代码编辑器有关系么?

试试
<%@ taglib tagdir="<%=request.getContextPath()%>/WEB-INF/tags" prefix="odbc"%>
------解决方案--------------------
我在MyEclipse里面是这么用的:
<%@ taglib uri="/WEB-INF/mytag.tld" prefix="f"%>
mytag.tld 在WEB-INF下面,
我想是不是需要指定到文件名呢?
------解决方案--------------------
我们项目中是这样用的
<%@ taglib prefix="htdz-tag" uri="/htdz-tag"%>
楼主可以试试这种方法 不知道对你有没有帮助
  相关解决方案