You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Christoph Jäger (JIRA)" <de...@tapestry.apache.org> on 2007/10/28 08:48:50 UTC

[jira] Created: (TAPESTRY-1865) ApplicationState depending on order of usage

ApplicationState depending on order of usage
--------------------------------------------

                 Key: TAPESTRY-1865
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1865
             Project: Tapestry
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.0.6
            Reporter: Christoph Jäger


(Basically copied from my email in the mailing list)

After upgrading from 5.0.5 to 5.0.6 my application somehow seems to not work
with the @ApplicationState as before.

I have three components on my page:

- LanguageSwitch
- MenuBar
- Login

Depending on who is logged in and the selected language, a different
menu is displayed. All three components have a property

@ApplicationState private Menu menu;

MenuBar has an additional property
private boolean menuExists;

to query if a menu has yet been set.

When the language is switched, the component calls "menu=null;" to force
the MenuBar component to create a new menu.

When someone logs in or out, the Login component calls "menu=null;" for
the same reason.

The MenuBar component calculates a new menu (based on selected language
and logged in user) if it finds that there is no existing menu
(menuExists==false).

This setup worked as expected in 5.0.5, but after I switched to 5.0.6,
the menu=null in the Login component seems to get ignored (from
LanguageSwitch it works as before). I think it depends on the order of
components: LanguageSwitch is before MenuBar, so MenuBar sees the
changes done in LanguageSwitch, but not the changes done in Login.

The Login component calls menu=null in two places: in
onSuccessFromFormLogin(), after the "Login" submit button was clicked,
and onActionFromLogout(), after the ActionLink titled "logout" is
clicked. I get the same behaviour for both calls.

What is strange here: adding some logging, I see that the click on the
"Switch Language" ActionLink, as well as the "logout" ActionLink and the
click on the "Login" button create two requests (this is as expected).
In the first request, menu=null is called. In the second request, the
MenuBar component checks for the existence of the menu property. Why
does the MenuBar in the second request not see the changes done in the
first request?

If a small example showing the problem is needed, please let me know.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1865) ApplicationState depending on order of usage

Posted by "Christoph Jäger (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547303 ] 

Christoph Jäger commented on TAPESTRY-1865:
-------------------------------------------

Sorry if my text was confusing.

I expect the MenuBar component to see the changes, as the changes are in an @ApplicationState marked property. This should be persisted somewhere in the server side session.




> ApplicationState depending on order of usage
> --------------------------------------------
>
>                 Key: TAPESTRY-1865
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1865
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Christoph Jäger
>
> (Basically copied from my email in the mailing list)
> After upgrading from 5.0.5 to 5.0.6 my application somehow seems to not work
> with the @ApplicationState as before.
> I have three components on my page:
> - LanguageSwitch
> - MenuBar
> - Login
> Depending on who is logged in and the selected language, a different
> menu is displayed. All three components have a property
> @ApplicationState private Menu menu;
> MenuBar has an additional property
> private boolean menuExists;
> to query if a menu has yet been set.
> When the language is switched, the component calls "menu=null;" to force
> the MenuBar component to create a new menu.
> When someone logs in or out, the Login component calls "menu=null;" for
> the same reason.
> The MenuBar component calculates a new menu (based on selected language
> and logged in user) if it finds that there is no existing menu
> (menuExists==false).
> This setup worked as expected in 5.0.5, but after I switched to 5.0.6,
> the menu=null in the Login component seems to get ignored (from
> LanguageSwitch it works as before). I think it depends on the order of
> components: LanguageSwitch is before MenuBar, so MenuBar sees the
> changes done in LanguageSwitch, but not the changes done in Login.
> The Login component calls menu=null in two places: in
> onSuccessFromFormLogin(), after the "Login" submit button was clicked,
> and onActionFromLogout(), after the ActionLink titled "logout" is
> clicked. I get the same behaviour for both calls.
> What is strange here: adding some logging, I see that the click on the
> "Switch Language" ActionLink, as well as the "logout" ActionLink and the
> click on the "Login" button create two requests (this is as expected).
> In the first request, menu=null is called. In the second request, the
> MenuBar component checks for the existence of the menu property. Why
> does the MenuBar in the second request not see the changes done in the
> first request?
> If a small example showing the problem is needed, please let me know.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Closed: (TAPESTRY-1865) ApplicationState depending on order of usage

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-1865.
------------------------------------------

    Resolution: Invalid
      Assignee: Howard M. Lewis Ship

So, what happens is that in the action request, the menu ASO is set to null; the attribute is removed from the HttpSession.

In the subsequent render request, the Menu component checks its menuExists boolean, and sees false (menu has been set to null), and it will then create and store a new menu ASO value.

That seems to match the scenario you describe, and is completely valid and expected.


> ApplicationState depending on order of usage
> --------------------------------------------
>
>                 Key: TAPESTRY-1865
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1865
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Christoph Jäger
>            Assignee: Howard M. Lewis Ship
>
> (Basically copied from my email in the mailing list)
> After upgrading from 5.0.5 to 5.0.6 my application somehow seems to not work
> with the @ApplicationState as before.
> I have three components on my page:
> - LanguageSwitch
> - MenuBar
> - Login
> Depending on who is logged in and the selected language, a different
> menu is displayed. All three components have a property
> @ApplicationState private Menu menu;
> MenuBar has an additional property
> private boolean menuExists;
> to query if a menu has yet been set.
> When the language is switched, the component calls "menu=null;" to force
> the MenuBar component to create a new menu.
> When someone logs in or out, the Login component calls "menu=null;" for
> the same reason.
> The MenuBar component calculates a new menu (based on selected language
> and logged in user) if it finds that there is no existing menu
> (menuExists==false).
> This setup worked as expected in 5.0.5, but after I switched to 5.0.6,
> the menu=null in the Login component seems to get ignored (from
> LanguageSwitch it works as before). I think it depends on the order of
> components: LanguageSwitch is before MenuBar, so MenuBar sees the
> changes done in LanguageSwitch, but not the changes done in Login.
> The Login component calls menu=null in two places: in
> onSuccessFromFormLogin(), after the "Login" submit button was clicked,
> and onActionFromLogout(), after the ActionLink titled "logout" is
> clicked. I get the same behaviour for both calls.
> What is strange here: adding some logging, I see that the click on the
> "Switch Language" ActionLink, as well as the "logout" ActionLink and the
> click on the "Login" button create two requests (this is as expected).
> In the first request, menu=null is called. In the second request, the
> MenuBar component checks for the existence of the menu property. Why
> does the MenuBar in the second request not see the changes done in the
> first request?
> If a small example showing the problem is needed, please let me know.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1865) ApplicationState depending on order of usage

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547295 ] 

Howard M. Lewis Ship commented on TAPESTRY-1865:
------------------------------------------------

I'm definately having trouble following your issue.

In terms of your final question:  "Why
does the MenuBar in the second request not see the changes done in the
first request?" ...

this is normal, on each request its as if the whole application starts anew, except for information in the request and in the server-side session. The MenuBar component's fields will have been "scrubbed" between requests.  After all, in a production app, it may be a different instance of the page (containing MenuBar) or even a different instance inside a different server of the application cluster.

> ApplicationState depending on order of usage
> --------------------------------------------
>
>                 Key: TAPESTRY-1865
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1865
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Christoph Jäger
>
> (Basically copied from my email in the mailing list)
> After upgrading from 5.0.5 to 5.0.6 my application somehow seems to not work
> with the @ApplicationState as before.
> I have three components on my page:
> - LanguageSwitch
> - MenuBar
> - Login
> Depending on who is logged in and the selected language, a different
> menu is displayed. All three components have a property
> @ApplicationState private Menu menu;
> MenuBar has an additional property
> private boolean menuExists;
> to query if a menu has yet been set.
> When the language is switched, the component calls "menu=null;" to force
> the MenuBar component to create a new menu.
> When someone logs in or out, the Login component calls "menu=null;" for
> the same reason.
> The MenuBar component calculates a new menu (based on selected language
> and logged in user) if it finds that there is no existing menu
> (menuExists==false).
> This setup worked as expected in 5.0.5, but after I switched to 5.0.6,
> the menu=null in the Login component seems to get ignored (from
> LanguageSwitch it works as before). I think it depends on the order of
> components: LanguageSwitch is before MenuBar, so MenuBar sees the
> changes done in LanguageSwitch, but not the changes done in Login.
> The Login component calls menu=null in two places: in
> onSuccessFromFormLogin(), after the "Login" submit button was clicked,
> and onActionFromLogout(), after the ActionLink titled "logout" is
> clicked. I get the same behaviour for both calls.
> What is strange here: adding some logging, I see that the click on the
> "Switch Language" ActionLink, as well as the "logout" ActionLink and the
> click on the "Login" button create two requests (this is as expected).
> In the first request, menu=null is called. In the second request, the
> MenuBar component checks for the existence of the menu property. Why
> does the MenuBar in the second request not see the changes done in the
> first request?
> If a small example showing the problem is needed, please let me know.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org