Title: RE: taglibs
Thank you very much for your reply, Grant. As suggested I went back to the basics to make sure my tags did work when I did not rely on the aliasing mechanisms. Doing this I discovered a couple of minor syntactical errors and semantical errors, which I fixed, and - voilla - suddently everything worked fine. Gradually I have now moved all the tags into a library, and I am now back at the beginning - this time with a system that works.
I am looking forward to the next versions of Orion which, hopefully, will have some more extensive debugging information - I think we really need that.
 
Thanks again for your input.
 
 
Randahl
 
 -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Grant Doran
Sent: 30. januar 2001 23:56
To: Orion-Interest
Subject: RE: taglibs

I had this problem early on.
Go back to basics to start with.
Your first step is to refer to the class directly and not through a jar file.

Try this:

1. Get rid of the <taglib> tag in the web.xml
2. Change the URI in the taglib.tld to:  <uri/>
3. When using the TAGLLIB directive in the JSP, refer to it using a relative or vitrual URL that you know is correct.
    eg: <%@ taglib uri="/taglib/jet.tld" prefix="jet" %>

This should work.
One of the problems that I've found is that using more elegant referencing to tags and taglibraries is not portable.
For instance, when I tried to port our EAR file to Weblogic 6.0, I spent the best part of a day trying to get the taglibrary to work even though the whole application runs fine on Orion.

By the time I had written Weblogic off, their support people finally got back to me with a "this is a known issue" (read BUG!).

Anyway, keep it simple to start with and that means using URIs instead of relying on aliasing mechanisms that Orion or J2EE provide.

Grant Doran
Principle Architect
iLaunch inc.
http://www.ilaunch.com/


-----Original Message-----
From: Randahl Fink Isaksen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 31 January, 2001 12:24 AM
To: Orion-Interest
Subject: taglibs


Hi

I am trying hard to get started with tag libraries, but for some reason I
keep getting an empty "HTTP 500 Internal server error" page when I call the
JSP page which uses my tag library - and the error is not explained in
Orion's log files.
I get the error when I try to use my tags - not when I reference the
library. I feel confident that my reference to the taglib in my JSP is
correct, because using a reference to an unexisting taglib results in an
error. But as soon as I call a tag from the library i get the error - i.e.
when writing something like <mytaglib:helloWorld>.

Below is a thorough description of the situation - any comments / thoughts
would be appreciated.

R.



Here is my setup:

============== the server ===============
Orion 1.3.8 running on Windows 2000 Professional

============== the tag ==================
public class HelloWorldTag extends TagSupport {

        public int doEndTag() throws JspException {
                try {
                        pageContext.getOut().write("The Tag says hello world!");
                }
                catch(java.io.IOException e) {
                        throw new JspTagException("IO Error: " + e.getMessage());
                }
                return EVAL_PAGE;
        }
}

============== web.xml ==================
        ...
        <taglib>
                <taglib-uri>jet</taglib-uri>
                <taglib-location>/WEB-INF/lib/taglib.jar</taglib-location>
        </taglib>
        ...

============== test.jsp =================
....
<%@ taglib uri = "jet" prefix = "jet" %>
....
<p>
        <jet:helloWorld>
</p>
....

============= taglib.tld ================
....
<taglib>
        <tlibversion>1.0</tlibversion> <jspversion>1.1</jspversion>
        <shortname>jet</shortname>
        <uri>http://www.orionserver.com/tutorials/mytags.jar</uri>
        <info>My first Tag library</info>

        <tag>
                <name>helloWorld</name>
                <tagclass>dk.rockit.jet.HelloWorldTag</tagclass>
                <bodycontent>empty</bodycontent>
                <info>A Hello World tag</info>
        </tag>
....

============ taglib.jar ================
meta-inf/taglib.tld
dk/rockit/jet/HelloWorldTag.class

Reply via email to