1

We have a JSF 2.2.13 , PrimeFaces 7.0.15 application hosted on client infrastructure. JSF STATE_SAVING_METHOD client

One of our new clients has a Azure Application Gateway Web Application Firewall (WAF) and the clients CyberSec Architect says that the maximum request body size cannot be made more than 128K.

We have 1 critical screen called the workbench that has a lot of tabs and grids which end up as a single xhtml page. (my suggestion of breaking the screen into menu and sub pages rather that tab was not acceptable during the design stage )

Now on click of certain tab the body size exceeds 128 kb and all subsequent ajax action fails.

Anyone ran into similar issue during application migration to azure cloud with WAF OR similar gateway issue restriction ?

Our current fix is to set the client up with STATE_SAVING_METHOD to server.

<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
</context-param>

<context-param>
    <param-name>com.sun.faces.numberOfViewsInSession</param-name>
    <param-value>1</param-value>
</context-param>
<context-param>
    <param-name>com.sun.faces.numberOfLogicalViews</param-name>
    <param-value>7</param-value>
</context-param>

Looking for some feedback and discuss some options that can implemented with redoing the entire screen :) Option 1 - STATE_SAVING_METHOD - server Option 2 - Can breaking into multiple forms be a possible option and then moving back to STATE_SAVING_METHOD client?

<p:tabView id="workTab" activeIndex="#{caseItemDetailsBean.activeIndexWorkTab}" dynamic="true" cache="false" styleClass="tab-no-pad">
                        <p:ajax event="tabChange" listener="#{caseItemDetailsBean.onChangeWorkTabs}" process="@this" update="form:workTab" />
                        <p:tab title="Actions">
                        <p:tab title="..."> 7 more tabs

Request Payload

Ravi
  • 391
  • 2
  • 18
  • What is the size of the largest field? Is it the `javax.faces.ViewState`? Is it close to 128k? If it is not already over this limit, using ajax and using partial submission via `partialSubmit="true"` might help too, see https://stackoverflow.com/questions/25339056/understanding-primefaces-process-update-and-jsf-fajax-execute-render-attributes. But yes, option 2 is what I would try first too afthere the previous suggestion – Kukeltje Aug 02 '20 at 06:45
  • javax.faces.ViewState=128 KB .. total request payload size 131 KB. javax.faces.partial.ajax: true . attached an image – Ravi Aug 02 '20 at 16:31
  • Then you need to break the page down in multiple smaller forms if possible since the viewstate is already on the limit – Kukeltje Aug 02 '20 at 18:02
  • 1
    the state is saved as "view-scope", not as "form-scope" ;) I would use server side. – tandraschko Aug 02 '20 at 19:01
  • @tandraschko: hmmm I was pretty sure a noticed a viewstate per form (once) but now I think of it, the name.... hmmm face, palm, shame... ;-) Too many hours in the sun today and in the flightsim. – Kukeltje Aug 02 '20 at 20:15

0 Answers0