AnsweredAssumed Answered

How to access environment entries in SURF?

Question asked by sujaypillai on Sep 23, 2010
Latest reply on Oct 22, 2010 by kevinr
I have an entry in web.xml as

<env-entry>
<description>welcome message</description>
<env-entry-name>message</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>Welcome to My Site</env-entry-value>
</env-entry>

and i access this in my .jsp page as -

<%
        javax.naming.Context context = new javax.naming.InitialContext();
        javax.naming.Context msg = (javax.naming.Context)context.lookup("java:comp/env");
        java.lang.String mesg = (java.lang.Boolean)msg.lookup("message");
        out.println("The message is : "+  mesg);
%>

How can this be done in SURF?

Outcomes