Java EE程序员不会写入文件 [英] Java EE programmers do not write to files

查看:105
本文介绍了Java EE程序员不会写入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天有人告诉我Java EE程序员不写文件。为什么我不能从Java EE容器中写入文件(例如从JBoss)?出了什么问题?

Today one person told to me that "Java EE programmers do not write to files". Why can I not write to files from within a Java EE container (for example from JBoss)? What is wrong?

推荐答案

要看的最佳页面是: http://www.oracle.com/technetwork/java/restrictions-142267.html

它详细介绍了对Java EE编程模型的限制。

It covers in detail the restrictions over the Java EE programming model.

除了上面提到的安全性,可移植性,群集,线程之外还考虑事务和错误处理(文件系统不是事务性的)。

Apart from the point mentionned above Security, Portability, Clustering, Threading also consider transactions and error handling (File systems are not transactional).

然而,JVM中没有黑魔法发生,你可以创建文件(只要你有相应的权利),使用静态变量,并在你知道自己在做什么的情况下创建线程。

There is however no black magic happening in the JVM and you can create files (as long as you have the corresponding rights), use static variables, and create threads if you know what you're doing.

最好花些时间来理解为什么通常会建议这些限制,为了顺从而跳转并写入JCA连接器。

Better take the time to understand why these restriction are usually suggested, than to jump and write a JCA connector for the sake of being compliant.

这篇关于Java EE程序员不会写入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆