You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Simon Kitching (JIRA)" <de...@myfaces.apache.org> on 2008/10/09 14:54:44 UTC

[jira] Resolved: (ORCHESTRA-28) Conversation (Access) is lost when jsf validation fails

     [ https://issues.apache.org/jira/browse/ORCHESTRA-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Kitching resolved ORCHESTRA-28.
-------------------------------------

    Resolution: Fixed

Fixed in trunk. Orchestra now does checks for unaccessed conversations only after rendering a new view. On validation-failure the viewId does not change, so unaccessed conversations are never discarded due to validation failure.

> Conversation (Access) is lost when jsf validation fails
> -------------------------------------------------------
>
>                 Key: ORCHESTRA-28
>                 URL: https://issues.apache.org/jira/browse/ORCHESTRA-28
>             Project: MyFaces Orchestra
>          Issue Type: Bug
>          Components: Conversation
>    Affects Versions: 1.1
>            Reporter: Stefan Glase
>            Priority: Critical
>
> I am loosing my conversation the bean CategoryController is in, when required-validation in the view fails. 
> Without further investigation it looks like it can be explained in the following way: Orchestra uses a proxy-class to notice calls to bean-methods,-getters or -setters while in the conversation and when there is no direct access to the bean from the view, the access scope will be lost. 
> That is fine in standard cases but when calls only go to the extending class this behaviour should be considered wrong.
> My ugly workaround can be seen in the bottom of the CategoryController implementation and the view, where I fetch this fake-property just to have a call to a bean-method.
> ***************************************************************************************************************************
> Class: CategoryController
> ***************************************************************************************************************************
> @Controller
> @Scope("conversation.access")
> public class CategoryController extends AbstractCrudController<Category> {
>     private CategoryService categoryService;
>     @Resource
>     public void setCategoryService(CategoryService categoryService) {
>         this.categoryService = categoryService;
>     }
>     @Override
>     protected CategoryService getService() {
>         return this.categoryService;
>     }
>     /**
>      * Bug: Orchestra invalidiert eine Klasse X, welche eine Klasse Y erweitert, wenn in einem
>      * Request-Zyklus lediglich Zugriffe auf Methoden und Properties von Y erfolgt sind.
>      * 
>      * @return Leerer String
>      */
>     public String getBug() {
>         return "";
>     }
> }
> ***************************************************************************************************************************
> Class: AbstractCrudController
> ***************************************************************************************************************************
> public abstract class AbstractCrudController<T extends PersistentEntity> {
>     private T entity;
>     public T getEntity() {
>         return entity;
>     }
> }
> ***************************************************************************************************************************
> View: categoryEditForm.xhtml
> ***************************************************************************************************************************
>        <h:form>
>             <h:panelGrid columns="3">
>                 <h:outputLabel value="#{msg.category_name}" for="name" />
>                 <h:inputText size="40" id="name" value="#{categoryController.entity.name}"
>                     required="true" />
>                 <h:message for="name" />
>                 <h:outputLabel value="#{msg.category_description}" for="description" />
>                 <h:inputTextarea rows="3" cols="40" id="description"
>                     value="#{categoryController.entity.description}" required="true" />
>                 <h:message for="description" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:commandButton action="#{categoryController.doSaveEntity}"
>                     value="#{msg.category_save}" />
>             </h:panelGrid>
>             <!-- === Bug === -->
>             <h:outputText value="#{categoryController.bug}" />
>             <!-- === End of Bug === -->
>         </h:form>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.