That works.  Thanks.

>>> [EMAIL PROTECTED] 10/29/02 7:16:31 AM >>>
Hi Derek,
Try ctx.listBindings("java:comp/env");

See http://www.oreilly.com/catalog/jservlet2/chapter/ch12.html 

HTH.

Ted Zimmerman

-----Original Message-----
From: Derek Nerenberg [mailto:dnerenberg@;sloanslake.com] 
Sent: Monday, October 28, 2002 4:50 PM
To: JRun-Talk
Subject: JRun Support for <env-entry> in web.xml


I'm trying to lookup <env-entry>s that I've put in the web.xml file (Jrun4).  When I 
view the environment (using the servlet below), the entries I put in the web.xml file 
do not show up.  Am I doing something wrong? 

Kind Regards,
Derek
=========================================

package sandbox;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.naming.*;

import java.io.*;
import java.util.*;

public class SimpleTestServlet 
extends HttpServlet 
{
  static final private String CONTENT_TYPE = "text/html";
  
  //Initialize global variables
  public void init() throws ServletException {}

  //Process the HTTP Get request
  public void doGet(HttpServletRequest request, HttpServletResponse response) 
        throws ServletException, IOException 
  {
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();

    out.println("<html>");
    out.println("<head><title>Get</title></head>");
    out.println("<body>");
    
    try
    {
      InitialContext ctx = new InitialContext();
      NamingEnumeration ne = ctx.listBindings(ctx.getNameInNamespace());
      while( ne.hasMoreElements() )
      {
        Binding b = (Binding)ne.nextElement();
        out.println("<p>class name: " + b.getClassName());
        out.println("<br>name: \t" + b.getName() );
        out.println("</p>");
      }
    }
    catch( Exception e )
    {     //eat it
    }
    out.println("</body></html>");
  }

  //Clean up resources
  public void destroy() {
  }
}



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=8
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to