0

I'm building a search page with primefaces 3.4 and omnifaces 1.3. Managed bean is SessionScoped.

I have a xhtml page with a:

<p:autoComplete id="searchBox" value="#{searchBean.queryText}"... />
<p:commandButton action="#{searchBean.search()}" value="search" ajax="false" .../>

 <p:dataTable id="docuList" var="doc"
                                     binding="#{searchBean.resultDataTable}"
                                     value="#{searchBean.lazyModel}" lazy="true"
                                     styleClass="noBorder" paginator="true" rows="10"
                                     paginatorPosition="bottom" 
                                     paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink}">
...
</p:dataTable>

SearchBean have a method search that initialize query and lazyDataModel.

LazyDataModel do a real query on db.

When session timeout I have an exception on lazyDataModel load method but FullAjaxExceptionHandler can't intercept that...

How can I manage exception in lazyDataModel to redirect to expired session page?

Thank you for any response.

Li Nu
  • 1
  • 1
  • Is the exception occurring during render response? In other words, the `FullAjaxExceptionHandler` has already logged a warning message *"An exception occurred during rendering JSF ajax response. Error page '/error.xhtml' CANNOT be shown as response is already committed."* ? – BalusC Feb 12 '13 at 15:52
  • No, in lazyDataModel I throw a new RuntimeException (just to test) if some parameter from sessionBean are null. I'll hope that FullAjaxExceptionHandler can intercept exception like showcase example – Li Nu Feb 12 '13 at 15:59
  • It's hard to understand the concrete problem. First, is the `FullAjaxExceptionHandler` triggered? Do you see its log in the server log? If it's not triggered then the exception is simply somewhere swallowed. – BalusC Feb 12 '13 at 17:49
  • No, I can't see any FullAjaxExceptionHandler log. – Li Nu Feb 13 '13 at 08:38

0 Answers0