Announcement Announcement Module
Collapse
No announcement yet.
change application context from in code Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • change application context from in code

    Hello,

    I'm developing a program for my thesis. It's a mobile program written in Flex and it uses spring actionscript
    Now I'm testing my software and I have a file (application-context.properties.txt). Here I have some variables like host, port,context, version
    so the text file looks like this:
    Code:
    host=(an ip address)
    port=8080
    context-root=(some text for my link)
    version=(project version)
    I use this things in my application context like :
    Code:
    value="http://${host}:${port}/${context-root}/..."
    Now when I use this it's hardcoded. Offcourse people want to connect on different servers. No I want to let the people give in there ip address.

    Does anybody know how I can change that in my application-context.properties.txt from my program?

    Kind regards,

    Thibault Heylen
    Last edited by Thibault; May 11th, 2011, 11:06 AM.

  • #2
    I found a solution for this problem.
    I will post it if I can help someone else with this.

    In my application-context I deleted this:
    Code:
    <object class="org.springextensions.actionscript.ioc.factory.config.flex.FlexPropertyPlaceholderConfigurer">
    	<property name="location"
    			  value="application-context.properties.txt"/>
    </object>
    then I changed my remoteobject with a ref instead of value:
    Code:
    	<object id="remoteObject"
    			class="mx.rpc.remoting.mxml.RemoteObject"
    			abstract="true">
    		<property name="endpoint"
    				  ref="mobileModelLocator.endPointUrl"/>
    		<property name="showBusyCursor"
    				  value="true"/>
    	</object>
    If there's still a problem pm me

    Comment

    Working...
    X