NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Contexts params from build.xml

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
hat27533



Joined: 10 Jan 2009
Posts: 3
Location: Cambridge UK

PostPosted: Sat Jan 10, 2009 6:37 pm    Post subject: Contexts params from build.xml Reply with quote

I am trying to build a 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 in a web application.

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:-
Quote:
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 !


[/code]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo