Web应用程序中序列化的目的 [英] Purpose of Serialization in webapplication

查看:132
本文介绍了Web应用程序中序列化的目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


1.在Web应用程序中使用序列化。

1.Where is the usage of serialization in a webapplication.

2.表格bean是否可以序列化。

2.Is it necessary that a form bean is serializable.

3.在tomcat中session.ser文件的用法是什么..

3.In tomcat what is the usage of sessions.ser file..


推荐答案

1)这是一个依赖于应用程序服务器的功能,但Servlet规范说如果servlet容器想要支持分布式环境(跨实例共享会话)等,它必须接受对象实现Serializable并能够迁移它们。 Tomcat还支持在服务器重新启动时为可序列化的会话对象存储会话状态。您可以在conf / context.xml文件中打开或关闭Tomcat的这个功能(请参阅那里的注释)。

1) It is an app server dependent feature but the Servlet Spec says that if the servlet container wants to support distributed environments (sharing sessions across instances) and the like that it must accept objects that implement Serializable and be able to migrate them. Tomcat also supports storing the session state across server restarts for session objects that are serializable. You can turn this feature of Tomcat on or off in the conf/context.xml file (see comments there).

2)表单bean只是必需的如果a)它是会话范围的b)你正在使用分布式会话或Tomcat使用的功能来持久化需要它的会话。

2) It would only be neceesary for a form bean to be Serializable if a) it is session scoped and b) you are using either distributed sessions or a feature such as Tomcat uses to persist the session which requires it.

3 )sessions.ser文件是包含会话中序列化对象的文件。如果您将服务器配置为重新启动服务器,Tomcat会使用它来保留它们(参见上文)。通常,.ser文件是序列化的Java对象,它是对象状态的二进制表示。

3) The sessions.ser file is the file containing the serialized objects from the session. Tomcat uses this to preserve them across restarts of the server if you have it configured to do so (see above). In general a .ser file is a serialized Java object, which is a binary representation of the state of the object.

这篇关于Web应用程序中序列化的目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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