我有一组数据,不需要存储在数据库中。
@javax.persistence.Entity
@Table(name = "users")
public class UserEntity extends Entity {
private static final long serialVersionUID = -7807480090652491368L;
@Transient
private Set<Long> productsIds = new LinkedHashSet<Long>();
}
另外,我有两个流程: cabinet :
<secured attributes="ROLE_USER" />
<on-start>
<evaluate expression="userService.loadUserEntityByEmail(currentUser.name)"
result="flowScope.user" />
</on-start>
<view-state id="cabinet" view="main.xhtml">
<transitions...
</view-state>
<view-state id="cart" view="cart.xhtml">
<transitions...
</view-state>
<end-states...
内容:
<on-start>
<evaluate
expression="currentUser!= null ? userService.loadUserEntityByEmail(currentUser.name) : null"
result="flowScope.user">
</evaluate>
</on-start>
<view-state id="content" view="content.xhtml">
<transitions...
</view-state>
<end-states...
我需要将数据Set<Long> productsIds
从content
传输到cabinet
(反之亦然,但它不是主要的)。
我也使用JSF 2.1,javascript,Servlet。也许在他们的帮助下传输数据会更容易