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

查看:23
本文介绍了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天全站免登陆