1

I'm starting now with conversationScoped in CDI and i'm thinking about how can i configure the pages in the same conversation.

I would like to configure a XML to say: page1 and page2 should be in the same conversationScoped, page3 should be in new conversation.

Obs: In seam 2 i know that have pages.xml, but i'm not using seam.

Which is the better way to do it ?

Ronaldo Lanhellas
  • 2,975
  • 5
  • 46
  • 92

1 Answers1

2

When you use CDI conversation scope you should manually begin and finish conversation by calling begin() and end() methods respectively. This doesn't have xml configuration out of the box.

JSF flow scope implements what you want. Flow scope is not a kind of conversation scope but rather a custom scope that spreads over several pages. This can be configured by xml or from Java code. Take a look at this link for a comprehensive example: https://blog.oio.de/2014/02/12/a-comprehensive-example-of-jsf-faces-flow/

A.Panzer
  • 391
  • 3
  • 15