2014年10月12日 星期日

struts2 ServletConfig

http://www.codejava.net/frameworks/struts/reading-parameters-from-webxml-in-struts2-action-class

  <context-param>
    <param-name>host</param-name>
    <param-value>192.168.123.233</param-value>
</context-param>




        String conf = ServletActionContext.getServletContext().getInitParameter("host");
      
        System.out.println("Login,conf: "+conf);

沒有留言:

張貼留言