0

I have a weird problem with PrettyFaces:

When combining a transient view (<f:view transient="true" />), named parameters in my pretty-config.xml (<pattern value="/document/#{id}" />), I get the following warning in my <h:messages />:

@ViewScoped beans are not supported on stateless views

The warning disappears as soon as I remove the #{id} from my pattern. I think that, somehow, PrettyFaces stores some state in the viewscope when using named parameters and JSF does not like it inside a transient view.

Is it a bug?

Xavier Dury
  • 1,530
  • 1
  • 16
  • 23
  • Not sure about PrettyFaces part, but stateless views are, uhm, stateless. So any view scoped bean tied to it would behave exactly like a request scoped bean. Simply because there's no means of a view state to store the view scoped bean in. I'm not sure why you're still attempting to use a view scoped bean on it. See also a.o. http://stackoverflow.com/q/14890995 – BalusC May 21 '15 at 21:37
  • The problem is that the only bean used in the view is a `@Model`... In fact I'm using the same bean for 2 different transient views (serving `/documents` and `/documents/#{id}`). Only the last one exhibits the problem... So I really think PrettyFaces tries to store things in the viewscope when named parameters are used. – Xavier Dury May 22 '15 at 06:45
  • I tested further... even if I don't use any bean at all in my view, I get the error. – Xavier Dury May 22 '15 at 07:04

1 Answers1

0

The problem seems to come from a bug in the JSF implementation.

See those 2 links:

Xavier Dury
  • 1,530
  • 1
  • 16
  • 23