Spring Jndi Context and PropertyPlaceholderConfigurer

前端 未结 4 903
鱼传尺愫
鱼传尺愫 2020-12-19 10:15

Using Spring, I want to read a variable inside the context of Webspehere.

Read a Environment Variable in Java with Websphere

To define the data.... inside we

4条回答
  •  悲&欢浪女
    2020-12-19 10:47

    I'm doing the same thing in my webapplication but unable to read from Initialcontext

    applicationcontext.xml has

     
        
        
         
     
    

    my.properties has

    default_mask=9999  
    

    trying to read

    Context context = new InitialContext();
    String resource = context.lookup("java:comp/env/default_mask");
    

    but the context's binding has only env-entry from web.xml, not from the properties file

提交回复
热议问题