The following can be found in JMC's QuickStart guide...
Hope this helps.
If you have the admin server running, you can access the quick
start guide by pointing to this link:
http://localhost:8000/quickStart/howdoi/tagStart.jsp
---
How do I Get Started with JSP custom tags?
Many developers find it helpful to code and run a simple example
before reading the documentation. The following procedure tells
you how to create a simple JSP custom tag:
Enter the following tag library descriptor and save it as
mytaglib.tld in the
<jruninstalldirectory>/servers/default/default-app/WEB-INF
directory (replace <jruninstalldirectory> with the path to the
directory in which you installed JRun):
<?xml version="1.0"?>
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>mylib</shortname>
<info>My First Tag Library</info>
<tag>
<name>date</name>
<tagclass>DateTag</tagclass>
<bodycontent>empty</bodycontent>
</tag>
</taglib>
Enter the following code and save it as DateTag.java in the
<jruninstalldirectory>/servers/default/default-app/WEB-INF/classes
directory (replace <jruninstalldirectory> with the path to the
directory in which you installed JRun):
import java.util.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class DateTag extends TagSupport {
public int doStartTag() throws JspTagException {
return EVAL_BODY_INCLUDE;
}
public int doEndTag() throws JspTagException {
JspWriter out = pageContext.getOut();
try {
out.println(new Date());
} catch (Exception ex) {
throw new JspTagException(ex.getMessage());
} finally {
return EVAL_PAGE;
}
}
}
Enter the following code and save it as MyCustomTagPage.jsp in the
/servers/default/default-app directory (replace with the path to
the directory in which you installed JRun):
<%@ taglib uri="/WEB-INF/mytaglib.tld" prefix="mylib" %>
Current time is <mylib:date/>.
Compile your code by entering the following commands:
cd <jruninstalldirectory>\servers\default\default-app\WEB-INF\classes
javac -classpath ".;<jruninstalldirectory>\lib\ext\servlet.jar" DateTag.java
Ensure that the JRun default server is running.
Open a browser and specify the following URL:
http://<server>:8100/MyCustomTagPage.jsp
The previous URL assumes that the JRun default server is running on port
8100.
If you have run the Connector Wizard successfully, you can also use
http://<server>/MyCustomTagPage.jsp
--
Clement Wong
JRun Engineer
< a l l a i r e >
-----Original Message-----
From: dion [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 09, 2000 4:51 AM
To: JRun-Talk
Subject: Newbie on taglib
Hello all,
i've been playing around with jsp + javabean,
but i'm still confused how to make my own taglib..
do you know good tutorial on it ?
or just give me the step by step guide in JRun...
i've seen taglibtutorial from orion :
http://www.orionserver.com/taglibtut/
still i can't make it work in even the simplest one (lesson 1) in
jrun... help please..??
thank you in advance.
--
Best regards,
dion mailto:[EMAIL PROTECTED]
----------------------------------------------------------------------------
--
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.