Announcement Announcement Module
Collapse
No announcement yet.
How to access environment entries in SURF? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to access environment entries in SURF?

    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?

    Thanks,
    Sujay Pillai

  • #2
    You cannot do this in a JavaScript backed webscript, but you can do whatever you like in a Java backed webscript - you can execute any Java...

    Kev

    Comment

    Working...
    X