This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom tags doubt

 
Pooja Shankar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anybody tell me where I went wrong....

myTag.tld
---------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<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>mytag</short-name>
<uri>dbs</uri>
<tag>
<name>dataBase</name>
<tag-class>com.customtag.log.MyTag</tag-class>
<body-content>jsp</body-content>
<attribute>
<name>update</name>
<required>true</required>
<rtexpression>true</rtexpression>
</attribute>
</tag>
</taglib>




myJsp.jsp
---------
<%@ taglib uri="dbs" prefix="db"%>
<db:update><%=(String)session.getAttribute("user")%></db:update>



MyTag.java
----------
package com.customtag.log;
import java.io.IOException;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
class MyTag extends SimpleTagSupport
{
public void doTag() throws IOException,JspException {
System.out.println("tag invoked....");
}
}


output
------
Exception rg.apache.jasper.JasperException: File "/jsp/dbs" not found
[ May 19, 2005: Message edited by: Pooja Shankar ]
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I think the problem is in <body-content> tag. The values should be scriptless|tagdependent|empty.

Thanks
 
Pooja Shankar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i've corrected in the pgm... i typed it wrong here....I don't understand why it does not work...

[ May 19, 2005: Message edited by: Pooja Shankar ]
[ May 20, 2005: Message edited by: Pooja Shankar ]
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

<db:update><%=(String)session.getAttribute("user")%></db:update>

Is it a correct use of tag? I think there is a problem.
"update" is attribute to tag.
Thanks
 
Pooja Shankar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx a lot Narendra Dhande....
the problem was that i was using jboss and had forgotten to include the tld file, while buildingwith ant...anyway...thanx.
Pooja
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is the <db:update> is working.

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic