从战争部署序列化对象
当我试图找到解决问题的方法时,我遇到了麻烦。 我有一个从互联网下载的 xml 架构,并用它创建 SchemaFactory。 代码是这样的:
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
问题是加载它需要花费大量的时间,所以我想序列化这个对象,然后反序列化它。 我什至没有成功地在战争中创建文件(读取我发现如何做的文件)。 如果有人能帮助我,我会很高兴。 谢谢, 帕维尔
I was getting into trouble when tried to find a solution for my problem.
I have an xml Schema that I download from the internet and create SchemaFactory with it.
The code goes like this:
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
The problem is that it takes a descent amount of time to load it so I want to serialize this object and then deserialize it .
I didn't succeed to even create a file within a war(read file I found how to do).
Would be glad if someone could help me.
Thanks,
Pavel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法在正在运行的战争中动态存储新文件。不过,您可以使用外部目录将序列化对象存储在文件中,或将其存储在数据库中。
You can't store a new file dynamically in a running war. You may use an external directory to store the serialized object in a file, though, or store it in a database.