DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > NetBeans
Reload this Page Getting web.xml context parameters from ant in build.xml
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2008
Default Getting web.xml context parameters from ant in build.xml - 01-09-2009, 03:13 PM

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
Reply With Quote
Reply

Tags
build.xml, web.xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Context Sensitive Help abravikumar Eclipse 2 01-30-2009 04:13 AM
PDE-Build in Eclipse 3.4 bomantz Eclipse 1 11-06-2008 01:52 PM
Problem with deleting Items from the Context Menu of my RCP App. alwin74 Eclipse 0 07-30-2008 09:09 AM
JDBC not bound in this context walterw Java 2 05-20-2008 06:43 AM
Headless build suma_eclipse Eclipse 0 03-06-2008 08:38 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com