已关注 writing hessian serivce我已经在我的 Spring 应用程序中设置了 Hessian Web 服务及其工作。
使用 org.springframework.remoting.caucho.HessianServiceExporter - SpringFramework 3.1、Hessian 4.0.1、
public interface RetailService {
List<User> getUserList();
}
@Component
public class RetailServiceImpl implements RetailService {
public List<User> getUserList() {
List<User> list=//get from db
return list;
}
}
class User{
String name,otherFields;
//Exclude this from serialization
Role role;
}
如何排除某些字段进行序列化。 我可以编写一个不包括 Role 的包装器/继承类,但我更喜欢使用现有类本身的简单内容(如注释)。
最佳答案
关于java - Hessian 排除字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13524612/