file not found

来源:2-2 开发第一个自定义标签

MR_HUPH

2016-07-09 17:18

我在做本节例子的时候把所有是imooc的地方都 替换成写成本公司的名字microBlue .运行结果报错为File "/microBlue-tag" not found。请问问题出在什么地方?

写回答 关注

2回答

  • 连宏伟HW
    2016-07-28 23:19:57

    有个步骤老师应该是省略了吧,我不清楚

    我是这样做的:

    tld文件中:

    <description>A tag library exercising SimpleTag handlers.</description>

        <tlib-version>1.0</tlib-version>

        <short-name>SimpleTagLibrary</short-name>

        <uri>/tag</uri>

        <tag>

            <name>dateTag</name>

            <tag-class>com.tag.DateTag</tag-class>

            <body-content>empty</body-content>

        </tag>

    JSP页面中;

    <%@ taglib prefix="simple" uri="/tag" %>

    还有就是写完tld文件中需要右键Build Path,Add to Build Path,添加到类库中,这个步骤老师没有说到

    运行就可以了

  • Mr夏之后
    2016-07-11 20:14:50

    jsp里面 --->

    <%@ taglib prefix="simple" uri="/simpletag" %>


    tld里面  ---->

    <description>JSTL 1.1 functions library</description>

    <tlib-version>1.0</tlib-version>

    <short-name>simple</short-name>

    <uri>/simpletag</uri>


    这样对应 就可以了吧,你试试


JSP自定义标签

JSP自定义标签应用,Java Web开发中一个重要的知识点

27135 学习 · 40 问题

查看课程