Migration to Wicket 7.0Page edited by Martin GrigorovChanges (1)
Full ContentMigrating to Wicket 7.0
EnvironmentWicket 7.0 requires at least Java 7Wicket 7.0 requires Servlet 3.0The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request. API changesorg/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0 org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.BoxBorder class has been deprecated in Wicket 6.x series org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions. org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable List<HeaderItem> WICKET-5124The old API returned Iterable<? extends HeaderItem> and was inconvenient to override and add additional dependencies. MyResourceReference.java @Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(dep1); dependencies.add(dep2); return dependencies; }
If in your application you have code like: MyComponent.java StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]); then the simplest solution is to use Model.of("Some default value"): MyComponent.java StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of("Some default value"), new Object[] [param1, param2]); org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174This method now accepts IValidationError as an argument and returns IValidationError. This way it can be used with other IValidationError implementations like RawValidationError for example. org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197This is done to make it more consistent with _javascript_ API. org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198This is done to make it more consistent with _javascript_ API. org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196To use AjaxFormValidatingBehavior in Wicket 6.x the application code should do something like: MyComponent.java AjaxFormValidatingBehavior.addToAllFormComponents(form, "keydown", Duration.ONE_SECOND); Due to the usage of static method it wasn't possible to extend this behavior and override for example #updateAjaxAttributes(AjaxRequestAttributes). The behavior has been reworked a bit to allow this. The new usage is: MyComponent.java form.add(new AjaxFormValidatingBehavior("keydown", Duration.ONE_SECOND); or MyComponent.java formComponent.add(new AjaxFormValidatingBehavior("keydown", Duration.ONE_SECOND); in this case the formComponent's owning Form will be used. org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212With WICKET-4958 has been introduced org.apache.wicket.ajax.AjaxRequestTarget.AbstractListener which is an empty implementation of AjaxRequestTarget.IListener to be able to introduce AbstractListener#updateAjaxAttributes() method - a place where an application can configure globally the Ajax attributes. With WICKET-5212 this new method is moved to the interface as well. org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213This way all registered ISessionListeners will be notified when a Session is unbound. (Base)WicketTester uses org.junit.Assert instead of junit.framework.Assertjunit.framework.Assert is deprecated. Due to this change org.junit.Assert#fail() throws now java.lang.AssertionError instead of junit.framework.AseertionFailedError org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227Component and Session's meta data must be serializable. org.apache.wicket.Application#getHeaderContributorListenerCollection() is renamed to #getHeaderContributorListeners()This way it is consistent with the other #getXyzListeners() methods in Application class org.apache.wicket.authorization.IAuthorizationStrategy#isResourceAuthorized(IResource, PageParameters) is introduced WICKET-5012Wicket 7.x supports authorization for requests to resources (IResource) additionally to authorization for components. org.apache.wicket.Component#setResponsePage() now accepts org.apache.wicket.request.component.IRequestablePage instead of org.apache.wicket.Pageorg.apache.wicket.Component#setResponsePage(page) just delegates to org.apache.wicket.request.cycle.RequestCycle#setResponsePage() that required just IRequestablePage. AutoCompleteTextField doesn't support useHideShowCoveredIEFix setting WICKET-5130useHideShowCoveredIEFix setting was needed for IE7 support. This version of IE is not supported officially anymore and this setting has been removed. Behavior changesorg.apache.wicket.request.Url#getQueryString WICKET-4664Url#getQueryString() now behaves as HttpServletRequest behaves :
RequestUtils#decodeParameters() now strips the "?" from the output value. org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934The value of the file name used in "Content-Disposition" response header can contain characters which should be encoded org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177This way it is in sync with AutoLabel (the auto component that is used for "wicket:for" attribute). org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li > span element for a feedback message WICKET-4831The css class is now only applied to the li element and not to the span inside. Additionally a FeedbackPanel#newMessageItem() method has been added to allow customization of each feedback message item (similar to DataTable#newRowItem()). AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197From now on only AjaxFallback** components prevent the default _javascript_ event behavior so only the Ajax call is made when _javascript_ is enabled in the browser. attributes.setPreventDefault(true); Ajax behaviors let _javascript_ events bubble by default WICKET-5198If _javascript_ events should not bubble then use: attributes.setEventPropagation(EventPropagation.STOP); or: attributes.setEventPropagation(EventPropagation.STOP_IMMEDIATE); PackageTextTemplate loads its content lazily WICKET-4579PackageTextTemplate will load its content at first usage of PackageTextTemplate#toString() or PackageTextTemplate#interpolate(Map) methods. AbstractLink no longer alters its markup to render itself as disabled WICKET-4904The href and disabled attributes are still added/removed by AbstractLink as required. But no further mangling of markup is performed. org.apache.wicket.markup.html.link.DisabledLinkBehavior can be used to restore the pre-Wicket-7.x representation of disabled links with <em><span></span></em> (note that <em> and <span> swap their position though). If the old behavior is need it can be easily re-applied by using org.apache.wicket.markup.html.link.DisabledLinkBehavior.LinkInstantiationListener. Button no longer silently ignores exceptions WICKET-5235... when it renders its model into the value attribute. Deprecated classes/methods/fields are removed WICKET-5201AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.They were deprecated since 6.0.0 and were there only for backward compatibility. Use #updateAjaxAttributes() to configure the same functionalities. The old Tree component in wicket-extensions is removed.It was based on Swing APIs and many people complained about this. Use the new Tree component introduced in Wicket 6.0.0 instead. Wicket.Window.unloadConfirmation has been removed WICKET-5246In Wicket 6 a new setting has been added to ModalWindow - org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#showUnloadConfirmation(). In Wicket 7 the new Java API should be used instead of dealing with the _javascript_ property Wicket.Window.unloadConfirmation. Using keyboard UP and DOWN keys will loop thru the options WICKET-5275If the currently selected item is the first one and the user uses KEY_UP then the selection will move to the last option. Similarly for KEY_DOWN - if the selected option is the last one then using DOWN key will move the selection to the first one. Dependency updatesAll libraries on which Wicket modules depend are updated to their latest stable versions.
Stop watching space
|
Change email notification preferences
View Online
|
View Changes
|
Add Comment
|
[CONF] Apache Wicket > Migration to Wicket 7.0
Martin Grigorov (Confluence) Wed, 24 Jul 2013 04:25:02 -0700
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... confluence
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Carl-Eric Menzel (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Carl-Eric Menzel (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)
- [CONF] Apache Wicket > Migration to Wicke... Martin Grigorov (Confluence)