JSF application traversing user session data

I have a complex JSF problem that I am trying to solve. Note that I am quite new to JSF and Java .... I have a simple application in which users log in, select some checkboxes, click "Submit", add additional information to another page, save to the database and log out.

In my env project, I see instances in which user session data intersects or caches and is written by a subsequent user session. For example, user A enters data, then User B enters data and, looking at his data, he sees the material entered by user A. Of course, I can not recreate this in the test.

I am using jsf 1.2._12, richfaces 3.3.2 and spring 2.5.6. Application Server - JBoss 5.

All my beans JSF managers are sessions. This particular managed bean calls the spring bean as my business object, which is the scope of the session, which ultimately calls the DAO, which is singleton.

Here relavant faces-config info

<managed-bean>
    <description>ContactBean</description>
    <managed-bean-name>ContactBean</managed-bean-name>
    <managed-bean-class>com.package.ContactBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>

    <managed-property>
        <property-name>dataElementBO</property-name>
        <value>#{dataElementBO}</value>
    </managed-property>

    <managed-property>
        <property-name>attributeBO</property-name>
        <value>#{attributeBO}</value>
    </managed-property>

    <managed-property>
        <property-name>dataElement2BO</property-name>
        <value>#{dataElement2BO}</value>
    </managed-property>

    <managed-property>
        <property-name>submissionBO</property-name>
        <value>#{submissionBO}</value>
    </managed-property>

    <managed-property>
        <property-name>selectedList</property-name>
        <property-class>java.util.ArrayList</property-class>
        <list-entries />
    </managed-property>

    <managed-property>
        <property-name>enteredContact</property-name>
        <property-class>java.util.ArrayList</property-class>
        <list-entries />
    </managed-property>
</managed-bean>

And my app-Context for the spring bean received the call

<bean id="submissionBO" class="com.package.submissionBOImpl" scope="session">
    <property name="submissionDAO">
        <ref bean="submissionDAO" />
    </property>
</bean>

When viewing web server logs, this problem occurred when user A and B were not even logged in at the same time. User A logged out and then User B logged in after almost 20 minutes.

I don’t understand how the use of the beans session scope can overlap in other user data ... is there something I don’t understand about how the scope of the scope is covered? If necessary, I can attach some code. Thanks in advance!

+3
source share
1

, bean? ?

0

Source: https://habr.com/ru/post/1791066/


All Articles