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

Igor Vaynberg reassigned WICKET-707:
------------------------------------

    Assignee: Matej Knopp

problem here is not that the page cannot implement the listener - that works 
fine, the problem is that our stateless processing is jacked up.

here is what happens in the example

index() executes
  urlfor(ihellolistenercalled)
    page.setpagestateless(false) <== good
page.renderpage()
 :856 // Reset it to stateless so that it can be tested again <== not good 
because it erases the previous set flag
  .. render ...
  :946 rest of stateless processing

so the problem is that the render method actually resets the stateless flag, so 
unless you always call urlfor during render phase a stateful page might be 
marked stateless and therefore when that link is executed the page wont be 
found in pagemap - thus pageexpired.

so looks like we need a "hard" stateless flag that the render wont reset

matej you know stateless stuff better then me so i am assigning it to you



> Invoking a request listener on a page returns an Expired Error page
> -------------------------------------------------------------------
>
>                 Key: WICKET-707
>                 URL: https://issues.apache.org/jira/browse/WICKET-707
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6
>            Reporter: paolo di tommaso
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.3.0-beta4
>
>
> The Page object being a Component should support the Wicket request listener 
> mechanism. 
> But invoking a request listener on page defined listener object it results in 
> a "Page Expired" error page. 
> To reproduce it  try the following code:
> public interface IHelloListener extends IRequestListener
> {
>         public static final RequestListenerInterface INTERFACE = new 
> RequestListenerInterface(IHelloListener.class);
>         void onHello();
> }
> public class HelloWorld extends WebPage implements IHelloListener
> {
>         public HelloWorld()
>         {
>                 add(new Label("message", "Hello World!"));
>                 WebMarkupContainer link = new WebMarkupContainer("link");
>                 link.add(new SimpleAttributeModifier("href", 
> RequestCycle.get().urlFor(this, IHelloListener.INTERFACE)));
>                 add(link);
>         }
>         public void onHello()
>         {
>                 RequestCycle.get().setRequestTarget(new IRequestTarget()
>                 {
>                         public void detach(RequestCycle requestCycle)
>                         {
>                         }
>                         public void respond(RequestCycle requestCycle)
>                         {
>                                 
> requestCycle.getResponse().write("<html><body>HELLO!</body></html>");
>                         }
>                         
>                         public Object getLock(RequestCycle requestCycle) {
>                                 return null;
>                         }
>                 });
>         }
> }

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

Reply via email to