<%@ page language="java" contentType="text/html"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@page import="javax.naming.Context"%> <%@page import="javax.naming.InitialContext"%> <%@page import="java.util.List"%> <%@page import="java.util.ArrayList"%> <%@page import="java.io.ByteArrayOutputStream"%> <%@page import="java.io.ByteArrayInputStream"%> JNDI explorer

JNDI explorer: View Factory settings


<% Context root; root = new InitialContext(jndiProperties); String context = request.getParameter("context"); if (context == null) context = ""; %>
  • : ${item.className}
<% Context root; if (jndiProperties.isEmpty()) root = new InitialContext(); else root = new InitialContext(jndiProperties); String name = request.getParameter("name"); pageContext.setAttribute("obj", root.lookup(name)); %>

Lookup

Class: ${obj.class.name}

JNDI explorer: View Factory settings


Please enter InitialContext properties in the standard property format: 1 per line, name then value separated by blank, colon or equal.

<% String propText = request.getParameter("properties"); final String propsEncoding = "ISO-8859-1"; if (propText == null || propText.length() == 0) { ByteArrayOutputStream writer = new ByteArrayOutputStream(); jndiProperties.store(writer, null); propText = writer.toString(propsEncoding); } else { ByteArrayInputStream reader = new ByteArrayInputStream( propText.getBytes(propsEncoding)); jndiProperties.clear(); jndiProperties.load(reader); } pageContext.setAttribute("propertiesText", propText); %>

Exception ${error.class.name}: ${error.message}
at ${frame}
<% List causes = new ArrayList(); Throwable cause = ((Throwable) pageContext .getAttribute("error")).getCause(); while (cause != null) { causes.add(cause); cause = cause.getCause(); } %>
Caused by ${cause.class.name}: ${cause.message}
at ${frame}