简体   繁体   中英

Flex, Java, BlazeDS and config file for my application

I'm programming Rich web applications with Flex and Java on Flex Builder 3 using blazeDS and SharedObjects. Now I need that my program will use configuration file. so, I need that my Java class will read it at the first time but the default path of java to read and write files is c:\\program files\\Flex Builder 3 and not my application directory inside the tomcat webapps directory How can I read the config file from the java class without write the path hardcoded in the java?

The SharedObjecs should only be written and read by your Flex application!

For accessing the file system (on the server side) from Java you can use an environment variable. Create and/or edit the setenv.sh|bat file in your tomcat/bin like this:

# setenv.sh
export MYAPP_HOME=/etc/myapp

# setenv.bat
set MYAPP_HOME=c:\myapp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM