tld 文件中的堆栈
我已经创建了一个自定义 tld 文件。并包含在我的jsp中。
myJsp
<%@ taglib uri="/WEB-INF/Tag.tld" prefix="Tag" %>
...
pageContext.setAttribute("pageBean", myPageBean);
pageContext.setAttribute("formBean", myformBean);
...
<Tag:draw pageBean="${pageBean}" Data="${formBean}"/>
my Tag.tld
如下所示
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" 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 web-jsptaglibrary_2_0.xsd">
<tlib-version>1.0</tlib-version>
<short-name>ct</short-name>
<uri>/WEB-INF/customTag</uri>
<tag>
<name>draw</name>
<tag-class>com.myPackage.calling.someOther.Class</tag-class>
<body-content>empty</body-content>
<info>Creates a graph based on the supplied input bean</info>
<attribute>
<name>Data</name>
<required>true</required>
<description>Provide a form graph bean</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>pageBean</name>
<required>true</required>
<description>Provide a Page Graph bean</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
现在我需要在此处放置堆栈跟踪。需要知道我的 jsp 是否正确导入了这个 tld 文件。需要有一些行可以从 tld 文件中获取 SOP ???
I have crated a custom tld file. And included in my jsp.
myJsp
<%@ taglib uri="/WEB-INF/Tag.tld" prefix="Tag" %>
...
pageContext.setAttribute("pageBean", myPageBean);
pageContext.setAttribute("formBean", myformBean);
...
<Tag:draw pageBean="${pageBean}" Data="${formBean}"/>
my Tag.tld
looks like below
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" 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 web-jsptaglibrary_2_0.xsd">
<tlib-version>1.0</tlib-version>
<short-name>ct</short-name>
<uri>/WEB-INF/customTag</uri>
<tag>
<name>draw</name>
<tag-class>com.myPackage.calling.someOther.Class</tag-class>
<body-content>empty</body-content>
<info>Creates a graph based on the supplied input bean</info>
<attribute>
<name>Data</name>
<required>true</required>
<description>Provide a form graph bean</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>pageBean</name>
<required>true</required>
<description>Provide a Page Graph bean</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
Now I need to put a stack trace here. Need to know if my jsp is properly importing this tld file. Need to have some line which would SOP from tld file ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该标签在 TLD 中声明和描述。 TLD 不包含任何可执行代码。
该标记的实现位于 TLD 中指定的类中:
com.myPackage.calling.someOther.Class
。把你想要的所有代码都放在这个类中。The tag is declared and described in the TLD. The TLD doesn't contain any executable code.
The implementation of the tag is in the class specified in the TLD:
com.myPackage.calling.someOther.Class
. Put all the code you want in this class.