2 Replies Latest reply on Apr 12, 2012 9:31 PM by raylite3

    Property value substitution in web.xml

    raylite3 Apprentice

      Hello,

       

      I am trying to get property value substitution to work in web.xml.

       

      I am using JBoss 7.1.1.Final and I have a simple servlet with a web.xml that specifies a init parameter value as ${simple.init.value:5}.

       

      I want to specify simple.init.value in a properties file (bin/standalone.sh -P simple.properties).

       

      {code:xml}

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"

                id="WebApp_ID" version="3.0">

                <display-name>SimpleWAR</display-name>

                <servlet-name>SimpleServlet</servlet-name>

                         <servlet-class>simple.servlet.SimpleServlet</servlet-class>

                          <init-param>

                                    <param-name>simple.init.param</param-name>

                                    <param-value>${simple.init.value:5}</param-value>

                          </init-param>

                          <load-on-startup>1</load-on-startup>

                </servlet>

      </web-app>

      {code}

       

      But I don't specify the property name getting resolved. In my servlet init method, I only get "${simple.init.value:5}".

       

      This used to work in JBoss5. Is this supposed to work in 7 as well?

      Thanks...