0

For page for print, which is text only, no command link/button to click, there is no need to save states for print pages. Is there a way to tell JSF not to save states? Thanks.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Dave
  • 487
  • 1
  • 6
  • 19

2 Answers2

2

JSF already won't save state anyway if the view does not contain any <h:form>. So there's nothing to worry about.

The <f:view transient="true">, which enables stateless mode since Mojarra 2.1.19, would not have any additional advantage if the view already doesn't contain any <h:form>.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • In our case, one JSF page is used for print/normal pages. can transient=#{bean.transient} ? so that one jsf page can be used for both transient and non-transient. Thanks. – Dave Apr 08 '13 at 00:15
1

With newer versions of Mojarra you can do this:

<f:view transient="true">
    Your page
</f:view>

But I don't think that doing this will have any significant positive effect on your application.

chkal
  • 5,598
  • 21
  • 26
  • Memory usage is critial for us. So we config numberOfViews=2, numberOfLogicalViews=2. print pages should not consume memory for the state saving. thanks. – Dave Apr 08 '13 at 00:18