Skip to content

EL expression / Resolved does not update value of bean in some condition [SPR-10380] #15013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Mar 14, 2013 · 15 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Mar 14, 2013

jorelia opened SPR-10380 and commented

We run WAS 8.0.0.x (x is 3 to 5) and we also test the case with JSF Mojarra 2.1.17, 2.1.19 and 2.1.20 and also RichFaces 4.2.1 and 4.3.1.

The application is running well under SPRING 3.0.6 whith any of above versions of any above framework with a minor problem with JSF Mojarra 2.1.20

What is happening is a little bit difficult to describe due to the conplexity of the application. However, we think that we have pinpoint a problem around the EL expression in particular conditions.

It's about a Web application in Single Page Application. Then the site is made of only one single page and this page is refreshed by ajax calls and dynamic includes of xhtml.

The problem comes when we include dynanically an XHTML fragment and that fragment contain a rich:datatable. Inside the rich:datatable, we have variable that is not updated with the most recent value. It keeps always the same value. The variable comes from the enclose page that creates dynamic tabs.

If you see the screen capture, we should have a value (-01-3 - green) instead of having the value (01-01) from the red. The variable is not update when the value is inside a rich:datatable / a4j:commandLink

Here is the involved code:

 basePase.xml (the page template)
    |
    |
    |
  index.xhtml  (We have tabs)
    |
    |---- include : searchClient.xhtml  (First static tab)
    |
    |----- listClient.xhtml  (dynamic tab inside a subview) - declare the "tab" variable
                 |
                 |
                 |----- rich:datable (Iteration on a collection of clients)
                 |
                 |
                 |----- <a4j:commandLink 
                                |
                                |
                                |- action="#{myController.doSthing(tab.id, client.UUID)}"
                                
This is the "tab" variable always contains the old value even if this value is updated by a refresh.
It is like the variable is keep cached.
<!--                 -->
<!--  CLIENT LIST    -->
<!--                 -->
<rich:dataTable id="resultListClient"
                binding="#{mergeClientController.dataTable}"
                var="client"
                value="#{tab.searchResult.data}"
                rendered="#{not tab.searchResult.isEmpty}"
                rows="30"
                styleClass="widther"
                onrowmouseover="javascript:onRowMouseOver(this);"
                onrowmouseout="javascript:onRowMouseOut(this);"
                rowClasses="odd-row, even-row"
                columnClasses="no-border">
   <rich:column id="verify" styleClass="center">
   <!--                 -->
   <!--    VERIFY CMD   -->
   <!--                 -->
   <f:facet name="header">
      <h:outputText value="" />
   </f:facet>
      <ui:fragment rendered="#{client.deceasedInd ne 'Y'}">
         <a4j:commandLink id="verifyCmd"
                          action="#{listClientController.doVerifyClient(tab.id, client.UUID)}"
                          render="desktopTabPanel,menuOpenedTabs"
                          value="#{msg['common.command.verify']}"
                          rendered="#{client.prospectInd ne 'Y'}"
                          onbegin="this.disabled = true"
                          oncomplete="this.disabled = false"
                          status="ajaxStatus" />
      </ui:fragment>
   </rich:column>
</rich:dataTable>

NOTE The variable tab.id is not refreshed when it is inside the datatable. But outside the datatable, the value become again correct. The variable is declared at the index.xhtml page.
Usually, its visibility is at any level even if there is a dynamic included page. It is a global variable.

<c:forEach items="#{desktopTabController.desktopTabBean.tabElements}" var="tab">
   <rich:tab id="#{tab.id}" render="menuOpenedTabs">
      <!--                -->
      <!--  DYNAMIC TABS  -->
      <!--                -->
      <f:facet name="header">
         &#160;<h:outputText id="#{tab.id}-tabTitle" value="Title" />
         &#160;<h:graphicImage id="#{tab.id}-closeButton"
                               value="/images/closeButton.png"
                               styleClass="closeButton"
                               onclick="checkIfTabInEditMode('#{tab.id}');stopPropagation(event);"
                               alt="X" />
      </f:facet>
      <c:if test="#{tab.id eq desktopTabController.activeTab}">
         <f:subview id="#{tab.id}-subview">
            <ui:include src="#{tab.xhtmlFile}" />
     </f:subview>
      </c:if>
   </rich:tab>
</c:forEach>

NOTE In this code, the "tab" variable is declared. The variable is seen by all include pages but not at the datatable component. It keep the old same value from the first call. So its means that it works for the first call but when we destroy the dynamic tab and that we create another one with another Id, the tab.id is kept the first value from the first dynamic tab. Then the value is not uptodate. The strange thing is that the value "client.UUID" is working well !!!

It looks like a bug from RichFaces or JSF but it was working with the version 3.0.6 of Spring. By upgrading Spring to 3.2.1 or 3.2.2 to have the benefit of fix JIRA #11536, it broke the software.

Step de reproduce:


  1. Select the Search tab - enter a value and submit
  2. Display the result list in new dynamic tab with a computed ID
  3. Click Annul button from the list and destroy the dynamic tab
  4. Repeat the step 1 and 2
  5. From the list Click verify link to open a client file
    5.1) You got a NPE because the tab variable is not update with the latest value from the newly computed ID of the tab.
    5.2 In Spring 3.0.6 it works perfectly but not when we upgraded to Spring 3.2.1 or 3.2.2

Affects: 3.2.1, 3.2.2

Attachments:

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

Faces config and web.xml

@spring-projects-issues
Copy link
Collaborator Author

Phil Webb commented

Would you be able to create a pull request for spring-framework-issues containing your example?

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

We're trying to figure out, to pinpoint the problem. We cannot definitively send you the software, too big and to complex. But we have a very small platform called ITHB (Integration Technologies Bug Hunter) to pinpoint the problem. We're trying to reproduce the problem. We can send you an adapted version of the ITBH with spring 3.0.6 because initially, the platform run with CDI from Glassfish which is Weld. We have first to convert the application from CDI to Spring 3.0.6. (Shipping soon).

ITBH is much less complex to the software we're building but enough complex to be able to reproduce the page layout and the page structure/hierarchy with the same mechanism.

What we're trying to determine if the bug is involved because we doing some wrong thing at the UI level, something that is permit with Spring 3.0.6 or because there is a real bug in Spring.

The question is why this specific part of this dynamic fragment (datable) is not uptodste as the other and as we used to with spring 3.0.6. There are several issues and problematic with JSF and Richfaces related to the dynamic include of XHTML fragment but also when we mix tag handlers like c:if, c:forEach and variable with components because the "building" time is not the same.

But for the moment, what we can say, under Spring 3.0.6, it was working, upgrading to Spring 3.2.1 or 3.2.2 is not, without changing any part at all of our code.

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

Here is the ITBH application under Spring 3.0.6. Please, read the readme.txt file at the root of NestedWeb folder for additional info.

This zip file contains a EAR and a WEB. You can manually create a web dynamic projet (NestedWeb) into your IDE and import the source files and also create a JavaEE application (NestedEar) which contain your web application.

The Web application contains all jar files needed except the richfaces jar files 4.3.1 which are to heavy to be uploaded.

We're working to adapt ITBH for having the missing Annul button we have at the real application to try to reproduce the behavior of this issue.

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

Here is the version with Spring 3.2.2 with the annul button to return back to the search.

However, despit of our endeavor we are not able to reproduce the case. So many things is different such as the servlet (2.5 vs 3.0) container, the J2EE container itslef (WAS vs GlassFish) and the application itself.

So the conclusion, may be may be not... :(

@spring-projects-issues
Copy link
Collaborator Author

Phil Webb commented

I wonder if the issue is with the c:forEach used to render the tabs. Have you tried using ui:repeat? Not much has changed with Spring's JSF support since 3.0.0 so anything you can do to prove where the issue lies would be appreciated.

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

Thx for your reply - However, we cannot use the ui:repeat, neither a4j:repeat because building dynamic tabs require c:forEach tag handler or similar. Such tabs have to be constructed during the building phases, before to be rendered.

We have to try the ITBH under WAS and it it still working, we do not have the choice to deconstruct the UI, piece by piece until the UI works again with Spring 3.2.2. There is probably a faulty component or tag or whatever that disturb the ui.

There is some issue with JSF with dynamic include and partial request and most of JSF developpers waiting for the 2.2....

@spring-projects-issues
Copy link
Collaborator Author

Phil Webb commented

Just to be clear, are you saying that your application works with Spring 3.0.6 but when changing to Spring 3.2.2 it breaks. Moreover Spring is the only dependency that you are changing (your Application Server, JSF implementation etc all remain the same)?

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

Yes - exact.

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

Please, it might interest you: JAVASERVERFACES-2016

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

We have tested ITBH on WAS 8.0.0.1 and it work perfectly. So, it means that there is something specific to the real application that do not allow to work with Spring 3.2.2. (except the "open" button from the list due to 2.1.20). We have to click twice. The "tab.id" variable is correct.

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

Just for background knowledge:

Then, I've also tested the case with JSF 2.1.21 which fix some issues. Moreover we got success in reproducing the bug about a click without backing bean action. Unfortunately, we are still not able to reproduce THIS bug on ITHB despite all our effort. But it is still here on the real application and the upgrade to JSF 2.1.21 did not do anything.

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

We have also made additional tests by replacing the a4j:xxxx by the standard JSF button and/or link to have plain POST/GET calls with the effect to reconstruct the whole page and the DOM. Unfortunately, we got the same behavior. Then, it should not be related to the page refresh behavior itself, neither by ajax calls, neither by standard calls. Something has changed related to parsing the el expressions ?

@spring-projects-issues
Copy link
Collaborator Author

jorelia commented

For your information and to be able to compare, here is a version of ITBH without Spring as CDI. This version use the CDI that should come with Glassfish (Weld). It may help you. just in case. This version works well.

@spring-projects-issues spring-projects-issues added type: bug A general bug status: waiting-for-triage An issue we've not yet triaged or decided on in: core Issues in core modules (aop, beans, core, context, expression) and removed type: bug A general bug labels Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process
Projects
None yet
Development

No branches or pull requests

2 participants