I am trying to build another bespoke netbeans(6.5) build.xml.
All I want to do is get a context paramater value from the web.xml during the build process.
I have a partial solution in that I can get all context parameter values thus :-
this is the context param section in my web.xml
Code:
<context-param>
<description>the version displayed in the login page</description>
<param-name>appVersion</param-name>
<param-value>1.0.1</param-value>
</context-param>
<context-param>
<description>The licence displayed in the login page.</description>
<param-name>licence_text</param-name>
<param-value>licence blurb goes here</param-value>
</context-param>
<context-param>
<description>Writes out debug messages if true and prevents emailing</description>
<param-name>debug</param-name>
<param-value>true</param-value>
</context-param>
I am trying to get the version number which is stored as a context parameter to use elsewhere in the build.xml file, this is a snippet of what I have in the build.xml :-
Code:
<!-- load web.xml -->
<xmlproperty file="web/WEB-INF/web.xml"
semanticAttributes="true" collapseAttributes="true" validate="false" />
<!-- set a property for later use -->
<property name="appVersion"
value="${web-app.context-param.param-value}" />
This gives me a comma separated string of all the context parameter values:-
1.0.1,licence blurb goes here,true
What I cant figure out is how to get an individual context parameter value, I am sure it can be done without having to parse the csv string.
Any pointers anyone, this is driving me nuts !
Neil