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
Get the JRun Web Application Construction Kit - the only book written specifically for
JRun developers.
http://www.amazon.com/exec/obidos/ASIN/0789726009/houseoffusion