tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <>
Subject using self created Context with jndi taglib
Date Fri, 16 Mar 2001 10:24:34 GMT
I'm trying to use the jndi taglib with a context that comes from my own
context pool.

The code is included below. But I guess that the context needs to be
references in the PageContext in order to be found by the tag?

Is there an easy way to do this? I plan to create a tag that fetches a
context from my context pool later, but for now it would be nice to be
able to put a context into the pagecontext temporarily.

<%@page contentType="text/html" import="profile.*, javax.naming.*" %>
<%@ taglib uri="" prefix="jndi" %>

<h3>Profile for </h3>

    ContextPool ctxPool = (ContextPool)
    System.out.println("context pool retrieved: " + ctxPool);

    System.out.println("using dn: " +
        + ", credentials: " + 

    Context testCtx =

    System.out.println("context retrieved: " + testCtx);

<jndi:lookup contextRef='testCtx' name='uid=test, ou=people,' id="hmm" /> 

<!-- doesn't work. the testCtx is not found. The exception is included
below -->


javax.servlet.jsp.JspException: context not set in a lookup invocation

- Torgeir

View raw message