Author: jfrederic.clere(a)jboss.com
Date: 2010-05-17 05:28:32 -0400 (Mon, 17 May 2010)
New Revision: 1472
Modified:
sandbox/webapps/myapp.xml
sandbox/webapps/src/TestServlet.java
Log:
See
http://labs.jboss.com/file-access/default/members/jbossweb/freezone/docs/...
Modified: sandbox/webapps/myapp.xml
===================================================================
--- sandbox/webapps/myapp.xml 2010-05-11 08:49:03 UTC (rev 1471)
+++ sandbox/webapps/myapp.xml 2010-05-17 09:28:32 UTC (rev 1472)
@@ -209,4 +209,10 @@
<role-name>manager</role-name>
</security-role>
+ <env-entry>
+ <env-entry-name>test</env-entry-name>
+ <env-entry-value>Toto</env-entry-value>
+ <env-entry-type>java.lang.String</env-entry-type>
+ </env-entry>
+
</web-app>
Modified: sandbox/webapps/src/TestServlet.java
===================================================================
--- sandbox/webapps/src/TestServlet.java 2010-05-11 08:49:03 UTC (rev 1471)
+++ sandbox/webapps/src/TestServlet.java 2010-05-17 09:28:32 UTC (rev 1472)
@@ -29,6 +29,9 @@
import javax.servlet.*;
import javax.servlet.http.*;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
/**
@@ -98,6 +101,19 @@
response.addHeader("", "empty");
return;
}
+ if (testValue != null &&
testValue.compareToIgnoreCase("JNDI")==0) {
+ out.println("<p>JNDI: <br/>");
+ try {
+ Context initCtx = new InitialContext();
+ Context envCtx = (Context) initCtx.lookup("java:comp/env");
+ String value = (String) envCtx.lookup("test");
+ out.println("JNDI test: " + value);
+ envCtx.close();
+ } catch (NamingException ne) {
+ out.println("JNDI test exception: " + ne);
+ }
+ out.println("</p>");
+ }
String createValue = request.getParameter("create");
int icreate = 0;
@@ -171,6 +187,7 @@
out.println("param: countvalue " + countValue + " counted: "
+ l);
out.println("param: waitvalue " + waitValue);
out.println("param: create " + createValue);
+ out.println("param: test " + testValue);
out.println("param: errcodevalue " + errcodeValue);
out.println("negative errcodevalue should display the error page
(404.html)");
out.println("<P>");