Hi,
At last, I have found the appropriate place for tag libraries. Here is a
"Hello" tag which I have tried. What I found useful with this approach is
that it doesn't need to create a jar file for the tags for development
purposes. Moreover while creating a .war file it's much easier to pack the
entire directory and we need not do anything extra.
If there is any other method which is more simpler or easier to maintain for
both development as well as packaging, please do let me know.
Step 1
--
Place all your tag handler source files in a package under WEB-INF\classes
directory. For example, I have used the following,
$ORION\\web\WEB-INF\classes\tagext\Hello.java
***
package tagext ;
import java.io.* ;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class Hello extends TagSupport {
public int doStartTag() throws JspException {
return EVAL_BODY_INCLUDE ;
}
public int doEndTag() throws JspException {
try {
pageContext.getOut().write( "Hello" ) ;
} catch ( IOException e ) {
throw new JspTagException( "JSP IOException" ) ;
}
return EVAL_PAGE ;
}
}
Step 2
--
Define TLD under WEB-INF\tlds directory. For example,
$ORION\\web\WEB-INF\tlds\taglib.tld
1.0
1.1
learn
Learn JSP Custom tags
hello
tagext.Hello
JSP
Simple Tag Example
Step 3
--
Referring a tag from JSP file. Example.
<%@ taglib uri="WEB-INF/tlds/taglib.tld" prefix="learn" %>
A Simple tag
With regards
sbchand
- Original Message -
From: "Mike Cannon-Brookes" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Saturday, December 23, 2000 2:56 AM
Subject: RE: Sharing Thoughts ...
> Looks like a great idea. You place your tag library jars in the
> web/WEB-INF/lib directory.
>
> (Or at least I do).
>
> Mike
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of S.
> > Balachandher
> > Sent: Saturday, December 23, 2000 4:47 AM
> > To: Orion-Interest
> > Subject: Sharing Thoughts ...
> >
> >
> > Hi,
> >
> > I just wanted to share my thoughts regarding Orion to you all.
> >
> > I am still a newbie with Orion Server. After reading thro' the
> > documentation, looking for information here & there, I have found the
> > following to be useful for "Orion Freshers" who want to kickstart their
> > application development.
> >
> > Directory Structure for a new J2EE application
> > --
> >
> > $ORION\\ - Application root
> > $ORION\\META-INF\application.xml - Descriptor for
Application
> > $ORION\\ejb\ - Root dir for EJB's
> > $ORION\\ejb\META-INF\ejb-jar.xml - Descriptor for EJB's
> > $ORION\\web\ - Root dir for Web
contents
> > $ORION\\web\WEB-INF\web.xml - Descriptor for
> > Web contents
> > $ORION\\web\WEB-INF\classes\ - Servlet dir
> > $ORION\\web\WEB-INF\lib\ - lib dir
> >
> > where $ORION is the home directory for Orion.
> >
> > $ORION\\META-INF\application.xml
> > -
> >
> > ..
> >
> > ejb
> >
> >
> >
> >
> > web
> > /
> >
> >
> >
> >
> > $ORION\\web\WEB-INF\web.xml
> >
> >
> > ..
> >
> >
> > index.html
> > index.jsp
> >
> >
> >
> > ejb/
> >
> >
> >
> >
> >
> >
> > Remember to add the following
> > -
> > in
> > $ORION\config\server.xml
> > > root="/" /> in
> > $ORION\config\default-web-site.xml
> >
> > Now start orion and just point http://[:port]/
> >
> > That's it.
> >
> > For combining everything into an .ear file, it's as simple as changing
> > ejb to ejb.jar and web to
> > web.war in
> > $ORION\\META-INF\application.xml
> >
> > Is there any other better method. If yes, please do let me know. In
the
> > meantime, I will start digging up Orion. Also I wanted to know where to
> > place my tag libraries, assuming I am following the above directory
> > structure.
> >
> > With regards
> > sbchand
> >
> >
> >
> >
> >
>
>