myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Gonzalez <>
Subject CODI ViewAccessScoped destroyed on GET request
Date Tue, 04 Dec 2012 10:32:13 GMT

I just began using @ViewAccessScoped.
Problem is that my bean is removed on some GET requests (h:link) - even if I'm always displaying
the same page using this viewAccessScoped bean.

Environment :
 * CODI 1.0.5
 * JBoss 7.1.0.Final

My page (test.xhtml) uses a single @ViewAccessScoped bean.

In my page I have :
 * a h:link pointing to test.xhtml
 * h:commandButton just doing a simple postback (no action, no navigation rule).

When I do :
 1. http://myhost/myapp/test.xhtml
 2. click on h:commandButton
 3. click on h:link

Everything works fine.

When I do :
 1. http://myhost/myapp/test.xhtml
 2. click on h:link
@PreDestroy and @PostConstruct are called in phase 6 of step 2 (the bean is removed and recreated).

Is this a bug or did I miss sthing ?

Thanks for the help !

here's my sample :
To reproduce failed testcase, just :
 1. http://myhost/myapp/test.xhtml on your browser
 2. click on first link '1.GET - windowId propagation'

jsf page 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en"
    <h:messages globalOnly="true"/>
      <li><h:link outcome="test.xhtml" value="GET - windowId propagation"/></li>
         <h:link outcome="test.xhtml" value="GET - no propagation">
           <f:param name="windowId" value=""/>
       <li><a href="#{facesContext.externalContext.request.contextPath}/test.xhtml?windowId=#{}">GET
- windowId propagation with a href</a></li>
           <h:commandButton value="POST"/> POST - windowId propagation

ViewAccess bean :
public class PingController implements Serializable {

private String value;
public void initialize() {

public void destroy() {

public String getValue() {
return value;

public void setValue(String value) {
this.value = value;

View raw message