我的应用程序的 Flex、Java、BlazeDS 和配置文件

发布于 2024-10-02 00:53:48 字数 232 浏览 1 评论 0原文

我正在使用 blazeDS 和 SharedObjects 在 Flex Builder 3 上使用 Flex 和 Java 编写丰富的 Web 应用程序。 现在我需要我的程序将使用配置文件。 所以,我需要我的Java类第一次读取它,但java读写文件的默认路径是c:\program files\Flex Builder 3,而不是tomcat webapps目录中的我的应用程序目录 如何从java类中读取配置文件而不写入java中硬编码的路径?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魂牵梦绕锁你心扉 2024-10-09 00:53:48

SharedObjecs 只能由您的 Flex 应用程序写入和读取!

要从 Java 访问文件系统(在服务器端),您可以使用环境变量。
tomcat/bin 中创建和/或编辑 setenv.sh|bat 文件,如下所示:

# setenv.sh
export MYAPP_HOME=/etc/myapp

# setenv.bat
set MYAPP_HOME=c:\myapp

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文