Java – in wicket 1.5 (. 2), there is no component reloaded on the URL?

For the first time, I used the following URL to navigate to my application:

In debug mode, I saw wicket instantiate my panel well (obviously)

If I change the URL to:

Then there is no response, the panel will not be reinitialized (for new users = > the data of user x is still displayed), nor is it loadabledetachable - or call other models

However, if I change the URL to:

Then initialize all panels for user y

Further, if you change the URL back to

Then display the data of user x again

Wicket doesn't seem to care whether the parameters in the URL have changed to decide whether to reload the component AFAIK works well in wicket 1.4 I think I understand the logic behind this behavior, but I'm not sure In addition, I want to know if the custom parameters change and how to remove "ugly" from the URL? 0 (if possible), how to force wicket to reload?

Solution

This is wicket's stateful property Page instantiation, parsing parameters, etc Later, you pass different parameters to the instantiated page, but this time its constructor is not called at all, so the pageparameters will not be updated Change to? 1 ask wicket for the page with ID 1, because no wicket instantiates a new instance and passes new parameters If you want to always have the latest request parameters, use getrequest() Getrequestparameter ("user"), which will provide you with the required information Makes sense?

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>