Thanks very much Emond for the good work!

I found some behavior confusing at first but I agree with Emond -
correctness provides the best result for PageExpiredException recovery
and keeps the framework clean.

After Emond has improved PageExpiredException recovery, there is still
one other area that could be addressed for a major improvement:

PageParameters missing from re-created Page
https://issues.apache.org/jira/browse/WICKET-5068

I am suggesting there a method that lets Component override a default
when it wants to process parameters during PageExpiredException
recovery in case the system thinks it should not do so.

Regards,

Bernard


On Tue, 20 Aug 2013 17:20:58 +0200, you wrote:

>Well, there is no urlFor method that takes a page, but if you use urlFor with 
>a RenderPageRequestHandler, the resulting url will be the same as this 
>method is not affected. Only the methods for RequestListenerInterface urls 
>are changed. For those, the url will be the bookmarkable version (with a 
>page id by the way). If you don't want that, your page should override 
>isBookmarkable and return false if it was constructed with the model 
>constructor.
>
>I don't think it's possible to prevent this. The current behavior was based 
>on isPageStateless, which was incorrect anyway. The result for your page 
>would have been the same if it is stateless. 
>Page.wasCreatedBookmarkable also does not give the desired result, as it 
>is only set when the page was created as a result of opening a 
>bookmarkable url, not by using a bookmarkable constructor.
>
>Best regards,
>Emond
>
>On Tuesday 20 August 2013 08:09:48 Igor Vaynberg wrote:
>> so what happens to the pages that are both bookmarkable and not?
>> 
>> public class EditCustomerPage {
>>   public EditCustomerPage(PageParameters params) {
>>       this(getEntity(params, "customer"));
>>   }
>> 
>>   public EditCustomerPage(IModel<Customer> customer) {
>>      ...
>>   }
>> }
>> 
>> what url will i get now when i say urlFor(new
>> EditCustomerPage(customerModel)) ?
>> 
>> -igor
>> 
>> 
>> On Tue, Aug 20, 2013 at 5:39 AM, Emond Papegaaij 
><[email protected]
>> > wrote:
>> > 
>> > On Monday 19 August 2013 17:32:45 Martin Grigorov wrote:
>> > > Hi Emond,
>> > > 
>> > > I think this change is OK.
>> > > Maybe we can improve it a bit by using
>> > 
>> > Application.get().getPageSettings().
>> > 
>> > > getRecreateMountedPagesAfterExpiry() in the checks above ?
>> > > 
>> > > With the new check as you can see the produced urls contain the 
>class
>> > 
>> > name.
>> > 
>> > > Some users don't like this.
>> > 
>> > 
>Application.get().getPageSettings().getRecreateMountedPagesAfterExpiry()
>> > 
>> > > return true by default. If someone doesn't like the extra info in the
>> > > produced urls then she can disable it this way.
>> > 
>> > I've thought some more about this, and I think the current behavior is 
>ok.
>> > If
>> > you don't want bookmarkable urls, but your page has a bookmarkable
>> > constructor, you should override isBookmarkable. The setting is more
>> > about request handling than it is about rendering urls. The reason the
>> > pageparameters are not rendered in the url is, that they would 
>otherwise
>> > be rendered as query parameters, overriding other (such as form)
>> > parameters.
>> > 
>> > I'll merge the branch somewhere tomorrow and forward port it to 7 if
>> > nobody objects.
>> > 
>> > Best regards,
>> > Emond

Reply via email to