You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martijn Dashorst <ma...@gmail.com> on 2010/09/29 14:38:45 UTC
Re: [CONF] Apache Wicket > Migration to Wicket 1.5
Is there a reason why a com.fredhopper method rename is added to the list of
modified methods?
I didn't know we shipped com.fredhopper packages with Wicket. :)
Martijn
On Wed, Sep 29, 2010 at 1:40 PM, <co...@apache.org> wrote:
> Migration to Wicket 1.5<https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5> Page
> *edited* by Martin Grigorov<https://cwiki.apache.org/confluence/display/~martin-g>
> Changes (1)
> ...
> |
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletResponse)
> |
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletRequest,
> HttpServletResponse) |
> |
> org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String,
> Class) | org.apache.wicket.protocol.http.WebApplication.mountPage(String,
> Class) |
> | com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> String) |
> com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> String, Locale, String, String) |
> Full Content
> Migrating to Wicket 1.5
>
> - Environment<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Environment>
> - Upgraded to JUNIT4<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-UpgradedtoJUNIT4>
> - Removed deprecated method, class and interface definitions<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Removeddeprecatedmethod%2Cclassandinterfacedefinitions>
> - Removed FormComponent.setPersistence()<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedFormComponent.setPersistence%28%29>
> - Removed IComponentBorder<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedIComponentBorder>
> - Component.getStyle() implementation changed<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Component.getStyle%28%29implementationchanged>
> - Removed magic from Border Component<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedmagicfromBorderComponent>
> - Component rendering<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Componentrendering>
> - UTF-8 encoded property files<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-UTF8encodedpropertyfiles>
> - TabbedPanel<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-TabbedPanel>
> - MarkupContainer.isTransparentResolver() removed<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-MarkupContainer.isTransparentResolver%28%29removed>
> - IComponentResolver.resolve API has changed<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-IComponentResolver.resolveAPIhaschanged>
> - Wicket-IOC changes<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-WicketIOCchanges>
> - Visitors<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Visitors>
> - Component Initialization - Component#onInitialize<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-ComponentInitializationComponent%23onInitialize>
> - Request parameters<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Requestparameters>
> - Switching to/from secured communication over https<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Switchingto%2Ffromsecuredcommunicationoverhttps>
> - HeaderContribution<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-HeaderContribution>
> - Component and IBehavior implement IHeaderContributor<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-ComponentandIBehaviorimplementIHeaderContributor>
> - Removed HeaderContributor and friends.<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedHeaderContributorandfriends.>
> - RequestCycle<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RequestCycle>
> - Exception handling<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Exceptionhandling>
> - ImageMap removed<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-ImageMapremoved>
> - getResourceSettings().setAddLastModifiedTimeToResourceReferenceUrl()
> has been replaced<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-getResourceSettings%28%29.setAddLastModifiedTimeToResourceReferenceUrl%28%29hasbeenreplaced>
> - Inter-component events<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Intercomponentevents>
> - List of renamed classes and methods<https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Listofrenamedclassesandmethods>
>
> Environment
>
> - Wicket 1.5 requires at least Java 5
>
> Upgraded to JUNIT4
>
> We changed the root pom.xml to use junit4 (4.7)
> Removed deprecated method, class and interface definitions
>
> In order to keep the code clean, we removed all methods, classes and
> interfaces which were marked deprecated in Wicket 1.4. Before migrating to
> Wicket 1.5 you should replace all deprecated invocations.
> Removed FormComponent.setPersistence()
>
> WICKET-2213 <https://issues.apache.org/jira/browse/WICKET-2213>: At the
> very beginning of Wicket we introduced FormComponent.setPersistence() with
> the idea to make creating Login panels very easy. Basically Wicket would
> deal with the Cookie handling for the login details. Now some years later it
> is evident that this feature is not very useful:
>
> - It basically is used for login panels only
> - Even in our examples Password.setPersistence is false which means
> that "rememberMe" doesn't really work. Only the user name is stored in a
> Cookie
> - Forcing formComponent.getPageRelativePath() as the Cookie name is too
> restrictive
> - You can not combine username and password into a single Cookie and
> e.g. decrypt it for safety reasons
>
> So we removed that feature and introduced IAuthenticationStrategy. A
> default implementation has been provided and the examples have been updated.
> As usual it gets registered with ISecuritySettings.
>
> In case you want to implement your own IAuthenticationStrategy, a utility
> class org.apache.wicket.util.cookies.CookieUtils has been added.
> Removed IComponentBorder
>
> The interface has been removed since IBehavior can do exactly the same.
> MarkupComponentBorder has been migrated, which means you can add associated
> markup to the behavior. Markup which will surround the behavior's component.
> Component.getStyle() implementation changed
>
> getStyle() used to return Component.getVariation() + "_" + style. That
> eventually caused issue such as mentioned in WICKET-2298<https://issues.apache.org/jira/browse/WICKET-2298>
> .
>
> We changed that to getStyle() now returning style only which as a
> consequence required us to change all resource related APIs to add
> variation. To migrate your code you might either provide
> component.getVariation() or null where not relevant.
> Removed magic from Border Component
>
> We had several issues with Border such as WICKET-2494<https://issues.apache.org/jira/browse/WICKET-2494>and the fact that all over core you could find code such as "if
> (comp instanceof Border) {}" . That is now all fixed, though at a (low)
> price. Because the magic is now gone, we think it is even clearer than is
> was before. The difference is you have to tell Border where to add the child
> component. Whether it will be added to <wicket:border>..</wicket:border>which is called the "border", or <span
> wicket:id="myBorder">..</span> which called the "border body". And because
> the body can be wrapped by a container such as a Form, you need to add
> (move) the body to the wrapper component via
> wrapper.add(getBodyContainer()) if needed. By doing so you create a clean
> component hierarchy with no more magic and ambiguities and transparent
> resolvers.
>
> border.addToBorder() and border.addToBorderBody() can be used to
> explicitly tell where to add the child. border.add() will add it the body.
>
> see Border javadoc as well
> Component rendering
>
> We used to have different entry points to render a Page, a Component for a
> web request and a Component for an AJAX request. That is history. Whenever
> you want to render a component, simply call component.render().
>
> You may recall that Component.render(MarkupStream) already existed and thus
> in most cases (e.g. IComponentResolvers implementations) you simply need to
> remove the markupStream parameter.
>
> The markup fragment which is still needed to render a Component is
> retrieved via Component.getMarkup(). Most components will ask their parent
> container to find it via MarkupContainer.getMarkup(Component child).
>
> IMarkupFragment is a new concept introduced. A markup fragment is what is
> says: a fragment of markup taken from a larger resource (file). Please see
> the javadoc on when it is better to subclass getMarkup() and when
> getMarkup(Component).
>
> Component.getMarkup() successfully returns a result as soon as it is
> connected (add) to a parent with an associated markup resource (file). Note
> that this usually is not in the component constructor, since the component
> itself will not yet been added to its parent.
>
> You may recall that until now you very carefully had to forward the markup
> stream to the next suitable position. That has been simplified as well.
> Every component will use its own markup stream and the parent container is
> responsible to position it while rendering its child components.
>
> On the same topic: onRender(MarkupStream) has been changed to onRender();
> no more MarkupStream. You can get for every component once you called
> render() via getMarkupStream().
> UTF-8 encoded property files
>
> If you are using Java 6 or newer, than Wicket will be configured to use java.util.Properties#load(Reader(in,
> "utf-8")) for files with "*.utf8.properties" extension.
> TabbedPanel
>
> - ITab.getPanel() now returns WebMarkupContainerWithAssociatedMarkup
> instead of Panel so it is now possible to create tabs using Fragments or
> Panels rather then just Panels.
> - TabbedPanel.setSelectedTab() is now chainable
> - TabbedPanel now takes a List<? extends ITab> rather then List<ITab>
>
> MarkupContainer.isTransparentResolver() removed
>
> We removed MarkupContainer.isTransparentResolver() in favor of the more
> general IComponentResolver. To make transition easy, we provide a
> TransparentWebMarkupContainer. In cases where
> TransparentWebMarkupContainer doesn't work for you, please see
> TransparentWebMarkupContainer on how to achieve the same effect with your
> component.
>
> Different than MarkupContainer.isTransparentResolver() where the
> component's id wasn't needed in the component's path, with
> IComponentResolver it must be included. Imagine you used to have a
> transparent container <body wicket:id="myBody">, you were able to access a
> label from the Page just by "myLabel". With the change, you must use
> "myBody:myLabel".
> IComponentResolver.resolve API has changed
>
> Until now, with IComponentResolver.resolve() is was your responsibility to
> render the component. You returned true, if the component was found and
> rendered. That was because we had different means to render the component
> and wicket itself was not able to judge which one to use. That has changed
> and thus we were able to change the IComponentResolver.resolve API. With
> the revised API, you simply return the resolved component and wicket core
> knows what to do with it. It made Wicket's internal code simpler and
> hopefully yours as well.
> Wicket-IOC changes
>
> InjectorHolder.getInjector().inject(Object object) is replaced with
> org.apache.wicket.injection.Injector.get().inject(Object object).
> This is valid for both Wicket-Spring and Wicket-Guice.
>
> Wicket-Guice's InjectionFlagCachingGuiceComponentInjector is removed. The
> replacement is GuiceComponentInjector. The caching mechanism that
> InjectionFlagCachingGuiceComponentInjector provided is moved to
> org.apache.wicket.injection.Injector so that the caching is re-used for both
> Wicket-Spring and Wicket-Guice.
> Wicket-Guice no more supports method injection. The same could be achieved
> with field injection. This way it is the same as Wicket-Spring and the
> involved code is highly reused between the IOC projects.
> Visitors
>
> Visitors have been cleaned up. Dependency on magic return values defined in
> Component#IVisitor have been replaced with a Component#IVisit object that
> allows the visitor to control the flow of the traversal.
>
> formComponent.visitChildren(Radio.class, new IVisitor<Component>()
> {
> public /*[1]*/ Object component(Component component /*[2]*/)
> {
> if (value.equals(component.getDefaultModelObject()))
> {
> addFormComponentValue(formComponent,((Radio<?>)component).getValue());
> return STOP_TRAVERSAL; /*[3]*/
> }
> return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER; /*[4]*/
> }
> });
>
> formComponent.visitChildren(Radio.class, new IVisitor<Component, Void>()
> {
> public void /*[1]*/ component(final Component component, final IVisit<Void> visit /*[2]*/)
> {
> if (value.equals(component.getDefaultModelObject()))
> {
> addFormComponentValue(formComponent,((Radio<?>)component).getValue());
> visit.stop(); /*[3]*/
> }
> else
> {
> visit.dontGoDeeper(); /*[4]*/
> }
> }
> });
>
> [1] The new style visitor no longer returns a value, instead the value
> can be returned using visit.stop(value)
> [2] The new visit object is introduced to control the visitor traversal
> [3] Instead of relying on magic return values the traversal is stopped by
> using the new visit object
> [4] Same as [3] but a different method on IVisit is used
> Component Initialization - Component#onInitialize
>
> A new callback method was added to Component class - onInitialize(). This
> method is intended to provide an alternate place to initialize the component
> in addition to standard constructors. The advantage of using this method
> over a constructor is that when it is invoked the Page and the markup of the
> component are both available and so a more complex initialization can take
> place.
>
> Before this method was introduced the developer had to rely on using
> onBeforeRender() method with some kind of "has-already-been-called-or-not"
> check to make sure the initialization code has only been run a single time.
> onInitialize() has this guarantee baked in - it will only be called once
> during the lifetime of the component.
> Request parameters
>
> To get the current request parameters (for example in Ajax behavior
> processing) in Apache Wicket 1.4:
>
> String parameterValue = RequestCycle.get().getRequest().getParameter(parameterName);
>
> In 1.5 you have a better control where the parameter comes from:
>
> // GET request StringValue parameterValue = RequestCycle.get().getRequest().getQueryParameters().getParameterValue(parameterName);
>
> // POST request StringValue parameterValue = RequestCycle.get().getRequest().getPostParameters().getParameterValue(parameterName);
>
> Or if you don't care about the method:
>
> StringValue parameterValue = RequestCycle.get().getRequest().getRequestParameters().getParameterValue(parameterName);
>
> Switching to/from secured communication over https
>
> In 1.4 a custom IRequestCycleProcessor is needed:
>
> public class MyApplication extends WebApplication
> {
> @Override
> protected IRequestCycleProcessor newRequestCycleProcessor()
> {
> return new HttpsRequestCycleProcessor(new HttpsConfig());
> }
> }
>
> In 1.5 this is re-implemented with the new HttpsMapper:
>
> public class MyApplication extends WebApplication
> {
> @Override
> public void init()
> {
> super.init();
>
> setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()));
> }
> }
>
> Registering HttpsMapper as a root mapper will check all pages before
> rendering for annotation @RequireHttps.
> HeaderContribution
>
> In 1.4 a custom HeaderContributor needed:
>
> new HeaderContributor(new IHeaderContributor() {
>
> private static final long serialVersionUID = 1L;
>
> @Override
> public void renderHead(IHeaderResponse response) {
> //your logic goes here }
> });
>
> This could be substitute with:
>
> new AbstractHeaderContributor() {
>
> @Override
> public void renderHead(IHeaderResponse response) {
> //your logic goes here }
> };
>
> Component and IBehavior implement IHeaderContributor
>
> Prior to 1.5 IHeaderContributor was used as a mixin for components and
> behaviors that wanted to write to the header, in 1.5 it is no longer
> necessary to implement the interface directly because both Component and
> IBehavior implement it.
> Removed HeaderContributor and friends.
>
> HeaderContributor was a convenience that did not add much and actually made
> things worst by increasing memory footprint in a lot of cases. Instead we
> can simply override IHeaderContributor#renderHead(IHeaderResponse) and
> achieve the same functionality in a simpler and consistent fashion.
>
> Wicket 1.4:
>
> public class MyPage extends WebPage {
> public MyPage() {
> add(HeaderContributor.forJavaScript(YuiLib.class, "yahoo-dom-event/yahoo-dom-event.js"));
> add(HeaderContributor.forCss(AbstractCalendar.class, "assets/skins/sam/calendar.css"));
> }
> }
>
> Becomes the following in 1.5:
>
> public class MyPage extends WebPage {
> public MyPage() {
> }
> public void renderHead(IHeaderResponse response) {
> response.renderJavascriptReference(new PackageResourceReference(YuiLib.class,
> "yahoo-dom-event/yahoo-dom-event.js"));
> response.renderCSSReference(new PackageResourceReference(AbstractCalendar.class,
> "assets/skins/sam/calendar.css"));
> }
> }
>
> Likewise,
>
> public class MyPage extends WebPage {
> public MyPage() {
> WebMarkupContainer c=new WebMarkupContainer();
> c.add(HeaderContributor.forJavaScript(YuiLib.class, "yahoo-dom-event/yahoo-dom-event.js"));
> add(c);
> }
> }
>
> becomes
>
> public class MyPage extends WebPage {
> public MyPage() {
> WebMarkupContainer c=new WebMarkupContainer();
> c.add(new AbstractBehavior() {
> public void renderHead(IHeaderResponse response) {
> response.renderJavascriptReference(new PackageResourceReference(YuiLib.class,
> "yahoo-dom-event/yahoo-dom-event.js"));
> }
> });
> add(c);
> }
> }
>
> RequestCycle
>
> RequestCycle has changed in 1.5-M1 and WebRequestCycle has been removed.
>
> When we want to override RequestCycle's methods and write our logic codes
> we can not do it like 1.4.x.
>
> eg.
> *ReqeustCycle*
>
> public MyRequestCycle extends WebRequestCycle {
> @Override
> public void onBeginRequest() {
> //... }
>
> @Override
> public void onEndRequest() {
> //... }
>
> @Override
> public Page onRuntimeException(Page page, RuntimeException e) {
> // ... }
> }
>
> In this case we'll need to extend RequestCycle and Override
> org.apache.wicket.Application.setRequestCycleProvider(IRequestCycleProvider)
> to return our a provider for a custom RequestCycle implementation.
> Exception handling
>
> In Wicket 1.4 it was needed to extend
> org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException).
> Wicket 1.5 gives even better control, by overriding
> org.apache.wicket.Application.newExceptionMapper() it is possible to change
> even the default processing of error pages.
> ImageMap removed
>
> ImageMap was deprecated in 1.4.11 and in 1.5 it was replaced with
> ClientSideImageMap component
> getResourceSettings().setAddLastModifiedTimeToResourceReferenceUrl() has
> been replaced
>
> With https://issues.apache.org/jira/browse/WICKET-3028 and
> https://issues.apache.org/jira/browse/WICKET-3021 this method was
> replaced. The timestamp, which previously was added as a query parameter to
> the resource url is now part of the file's basename (the name part before
> the extension). This has several advantages and gives you best possible
> caching support. See for example chapter
>
> Use fingerprinting to dynamically enable caching
>
> in
>
> http://code.google.com/intl/de-DE/speed/page-speed/docs/caching.html
>
> The feature is enabled by default so unless you want to disable it with
> getResourceSettings().setUseTimestampOnResources(boolean) or query its
> state with getResourceSettings().getUseTimestampOnResources() you usually
> don't have to care about it at all. Timestamping only works when the
> ResourceReference supports a last modified timestamp and returns a non-null
> timestamp for method ResourceReference.getLastModified(). This is always
> true for package resources and wicket:link.
> Inter-component events
>
> Wicket 1.5 offers a simple, yet flexible, way for component to communicate
> with each other in a decoupled manner. The two major interfaces that
> facilitate this are:
>
> /**
> * Objects that can send events
> *
> * @author Igor Vaynberg (ivaynberg)
> */public interface IEventSource
> {
> /**
> * Sends an event
> *
> * @param <T>
> * tyep of payload
> *
> * @param sink
> * object that will receive the event
> * @param broadcast
> * if the object that receives the event needs to broadcast it to others, this is the
> * type of broadcast that should be used
> * @param payload
> * event payload
> */
> <T> void send(IEventSink sink, Broadcast broadcast, T payload);
> }
>
> and
>
> /**
> * Objects that can receive events
> *
> * @author Igor Vaynberg (ivaynberg)
> */public interface IEventSink
> {
> /**
> * Called when an event is sent to this sink
> *
> * @param event
> */
> void onEvent(IEvent<?> event);
> }
>
> .
>
> The classes that implement these interfaces, and can thus participate in
> the event mechanism are: Component, RequestCycle, Session, and Application.
>
> The mechanism allows for different event broadcast methods defined here:
>
> /**
> * Defines the event broadcast type.
> *
> * @author igor
> */public enum Broadcast {
> /**
> * Breadth first traversal. Supported sinks in order of traversal:
> *
> * <ol>
> * <li>{@link Application}</li>
> * <li>{@link Session}</li>
> * <li>{@link RequestCycle}</li>
> * <li>{@link Page}</li>
> * <li>{@link Component}s</li>
> * </ol>
> *
> * Any sink along the path can be specified and traversal will start with the specified sink as
> * root, eg:
> *
> * <ul>
> * <li>If a component inside the page is specified then only the component and all its children
> * will receive the event</li>
> * <li>If Session is specified then the session, the request cycle, the page and all its
> * components will receive the event</li>
> * </ul>
> */
> BREADTH,
> /**
> * Depth first traversal. Supported sinks in order of traversal:
> *
> * <ol>
> * <li>{@link Component}s</li>
> * <li>{@link Page}</li>
> * <li>{@link RequestCycle}</li>
> * <li>{@link Session}</li>
> * <li>{@link Application}</li>
> * </ol>
> *
> * Any sink along the path can be specified and traversal will start with the specified sink as
> * root, eg:
> *
> * <ul>
> * <li>If a component inside the page is specified then only the component and all its children
> * will receive the event</li>
> * <li>If Session is specified then the session, the request cycle, the page and all its
> * components will receive the event</li>
> * </ul>
> *
> */
> DEPTH,
> /**
> * A bubble-up traversal. In a bubble-up traversal only the sink and its parents are notified.
> *
> * Supported sinks in order of traversal are:
> * <ol>
> * <li>{@link Component}s</li>
> * <li>{@link Page}</li>
> * <li>{@link RequestCycle}</li>
> * <li>{@link Session}</li>
> * <li>{@link Application}</li>
> * </ol>
> *
> * Any sink along the path can be specified and traversal will start at the specified sink and
> * work its way up to the {@link Application}, eg:
> *
> * <ul>
> * <li>If a component inside the page is specified then only the component, its parents, the
> * request cycle, the session, and the application will be notified.
> * <li>If Session is specified then the session, the application will be notified</li>
> * </ul>
> */
> BUBBLE,
> /**
> * Only the specified sink receives the event
> */
> EXACT;
> }
>
> There is an example in wicket-examples which demonstrates the usage of
> this.
> List of renamed classes and methods
> 1.4 1.5 org.apache.wicket.request.resource.ResourceReference org.apache.wicket.request.resource.PackageResourceReference org.apache.wicket.RedirectToUrlException org.apache.wicket.request.flow.RedirectToUrlException org.apache.wicket.Request org.apache.wicket.request.Request org.apache.wicket.RequestCycle org.apache.wicket.request.cycle.RequestCycle org.apache.wicket.RequestCycle.urlFor org.apache.wicket.request.cycle.RequestCycle.renderUrlFor org.apache.wicket.util.lang.Objects.cloneObject(Object) org.apache.wicket.util.lang.WicketObjects.cloneObject(Object) org.apache.wicket.protocol.http.WebRequest org.apache.wicket.request.http.WebRequest org.apache.wicket.protocol.http.WebResponse org.apache.wicket.request.http.WebResponse org.apache.wicket.request.target.basic.RedirectRequestTarget RedirectRequestHandler org.apache.wicket.request.target.coding.QueryStringUrlCodingStrategy use PageParameters.getNamedParameter(String) with any IRequestHandler org.apache.wicket.request.http.WebRequest.getHttpServletRequest() org.apache.wicket.protocol.http.servlet.ServletWebRequest.getHttpServletRequest()
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(final
> HttpServletResponse) (missing) org.apache.wicket.Application.set(Application) org.apache.wicket.ThreadContext.setApplication(Application) org.apache.wicket.protocol.http.BufferedWebResponse.BufferedWebResponse(HttpServletResponse)
> org.apache.wicket.protocol.http.BufferedWebResponse.BufferedWebResponse(WebResponse)
> org.apache.wicket.PageParameters org.apache.wicket.request.mapper.parameter.PageParameters PageParameters.put(String, String) org.apache.wicket.request.mapper.parameter.PageParameters.setNamedParameter(String,
> Object) org.apache.wicket.protocol.http.HttpSessionStore org.apache.wicket.session.HttpSessionStore org.apache.wicket.protocol.http.WebApplication.newSessionStore() (missing, HttpSessionStore is the only supported) org.apache.wicket.markup.html.resources.CompressedResourceReference org.apache.wicket.request.resource.CompressedResourceReference org.apache.wicket.markup.html.resources.JavascriptResourceReference org.apache.wicket.request.resource.JavascriptResourceReference org.apache.wicket.markup.html.image.Image.Image(String) (this constructor is protected in 1.5, as replacement can be used
> NonCachingImage(String)) org.apache.wicket.markup.html.image.resource.DynamicImageResource org.apache.wicket.request.resource.DynamicImageResource org.apache.wicket.util.convert.ConverterLocator org.apache.wicket.ConverterLocator org.apache.wicket.util.lang.Objects org.apache.wicket.util.lang.WicketObjects org.apache.wicket.protocol.http.WebApplication.sessionDestroyed(String) org.apache.wicket.protocol.http.WebApplication.sessionUnbound(String) org.apache.wicket.protocol.https.HttpsRequestCycleProcessor org.apache.wicket.protocol.https.HttpsMapper org.apache.wicket.PageParameters.getInt(String) org.apache.wicket.request.mapper.parameter.PageParameters.getNamedParameter(String).toInt() org.apache.wicket.protocol.http.WebRequestCycle.newBrowserInfoPage(String)
> org.apache.wicket.protocol.http.WebSession.newBrowserInfoPage(String) org.apache.wicket.protocol.http.WebApplication.newWebRequest(HttpServletRequest)
> org.apache.wicket.protocol.http.WebApplication.newWebRequest(HttpServletRequest,
> String) org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletResponse)
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletRequest,
> HttpServletResponse) org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String,
> Class) org.apache.wicket.protocol.http.WebApplication.mountPage(String,
> Class) com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> String) com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> String, Locale, String, String)
> Change Notification Preferences<https://cwiki.apache.org/confluence/users/viewnotifications.action>
> View Online<https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5>| View
> Changes<https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=2853449&revisedVersion=53&originalVersion=52>| Add
> Comment<https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5?showComments=true&showCommentArea=true#addcomment>
>
--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8
Re: [CONF] Apache Wicket > Migration to Wicket 1.5
Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Sep 29, 2010 at 2:38 PM, Martijn Dashorst <
martijn.dashorst@gmail.com> wrote:
> Is there a reason why a com.fredhopper method rename is added to the list
> of
> modified methods?
>
> I didn't know we shipped com.fredhopper packages with Wicket. :)
>
You gave me the karma to commit in svn.apache.org... Now you'll have to
support whatever I commit there :-)
Fixed. Thanks!
c.f.** is being migrated to Wicket 1.5 to see what is still missing in 1.5
compared to 1.4.
>
> Martijn
>
> On Wed, Sep 29, 2010 at 1:40 PM, <co...@apache.org> wrote:
>
> > Migration to Wicket 1.5<
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5>
> Page
> > *edited* by Martin Grigorov<
> https://cwiki.apache.org/confluence/display/~martin-g<https://cwiki.apache.org/confluence/display/%7Emartin-g>
> >
> > Changes (1)
> > ...
> > |
> >
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletResponse)
> > |
> >
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletRequest,
> > HttpServletResponse) |
> > |
> >
> org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String,
> > Class) | org.apache.wicket.protocol.http.WebApplication.mountPage(String,
> > Class) |
> > |
> com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> > String) |
> > com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> > String, Locale, String, String) |
> > Full Content
> > Migrating to Wicket 1.5
> >
> > - Environment<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Environment>
> > - Upgraded to JUNIT4<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-UpgradedtoJUNIT4>
> > - Removed deprecated method, class and interface definitions<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Removeddeprecatedmethod%2Cclassandinterfacedefinitions
> >
> > - Removed FormComponent.setPersistence()<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedFormComponent.setPersistence%28%29
> >
> > - Removed IComponentBorder<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedIComponentBorder
> >
> > - Component.getStyle() implementation changed<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Component.getStyle%28%29implementationchanged
> >
> > - Removed magic from Border Component<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedmagicfromBorderComponent
> >
> > - Component rendering<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Componentrendering
> >
> > - UTF-8 encoded property files<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-UTF8encodedpropertyfiles
> >
> > - TabbedPanel<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-TabbedPanel>
> > - MarkupContainer.isTransparentResolver() removed<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-MarkupContainer.isTransparentResolver%28%29removed
> >
> > - IComponentResolver.resolve API has changed<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-IComponentResolver.resolveAPIhaschanged
> >
> > - Wicket-IOC changes<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-WicketIOCchanges>
> > - Visitors<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Visitors>
> > - Component Initialization - Component#onInitialize<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-ComponentInitializationComponent%23onInitialize
> >
> > - Request parameters<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Requestparameters
> >
> > - Switching to/from secured communication over https<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Switchingto%2Ffromsecuredcommunicationoverhttps
> >
> > - HeaderContribution<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-HeaderContribution
> >
> > - Component and IBehavior implement IHeaderContributor<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-ComponentandIBehaviorimplementIHeaderContributor
> >
> > - Removed HeaderContributor and friends.<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RemovedHeaderContributorandfriends
> .>
> > - RequestCycle<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-RequestCycle>
> > - Exception handling<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Exceptionhandling
> >
> > - ImageMap removed<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-ImageMapremoved>
> > - getResourceSettings().setAddLastModifiedTimeToResourceReferenceUrl()
> > has been replaced<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-getResourceSettings%28%29.setAddLastModifiedTimeToResourceReferenceUrl%28%29hasbeenreplaced
> >
> > - Inter-component events<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Intercomponentevents
> >
> > - List of renamed classes and methods<
> https://cwiki.apache.org/confluence#MigrationtoWicket1.5-Listofrenamedclassesandmethods
> >
> >
> > Environment
> >
> > - Wicket 1.5 requires at least Java 5
> >
> > Upgraded to JUNIT4
> >
> > We changed the root pom.xml to use junit4 (4.7)
> > Removed deprecated method, class and interface definitions
> >
> > In order to keep the code clean, we removed all methods, classes and
> > interfaces which were marked deprecated in Wicket 1.4. Before migrating
> to
> > Wicket 1.5 you should replace all deprecated invocations.
> > Removed FormComponent.setPersistence()
> >
> > WICKET-2213 <https://issues.apache.org/jira/browse/WICKET-2213>: At the
> > very beginning of Wicket we introduced FormComponent.setPersistence()
> with
> > the idea to make creating Login panels very easy. Basically Wicket would
> > deal with the Cookie handling for the login details. Now some years later
> it
> > is evident that this feature is not very useful:
> >
> > - It basically is used for login panels only
> > - Even in our examples Password.setPersistence is false which means
> > that "rememberMe" doesn't really work. Only the user name is stored in
> a
> > Cookie
> > - Forcing formComponent.getPageRelativePath() as the Cookie name is
> too
> > restrictive
> > - You can not combine username and password into a single Cookie and
> > e.g. decrypt it for safety reasons
> >
> > So we removed that feature and introduced IAuthenticationStrategy. A
> > default implementation has been provided and the examples have been
> updated.
> > As usual it gets registered with ISecuritySettings.
> >
> > In case you want to implement your own IAuthenticationStrategy, a utility
> > class org.apache.wicket.util.cookies.CookieUtils has been added.
> > Removed IComponentBorder
> >
> > The interface has been removed since IBehavior can do exactly the same.
> > MarkupComponentBorder has been migrated, which means you can add
> associated
> > markup to the behavior. Markup which will surround the behavior's
> component.
> > Component.getStyle() implementation changed
> >
> > getStyle() used to return Component.getVariation() + "_" + style. That
> > eventually caused issue such as mentioned in WICKET-2298<
> https://issues.apache.org/jira/browse/WICKET-2298>
> > .
> >
> > We changed that to getStyle() now returning style only which as a
> > consequence required us to change all resource related APIs to add
> > variation. To migrate your code you might either provide
> > component.getVariation() or null where not relevant.
> > Removed magic from Border Component
> >
> > We had several issues with Border such as WICKET-2494<
> https://issues.apache.org/jira/browse/WICKET-2494>and the fact that all
> over core you could find code such as "if
> > (comp instanceof Border) {}" . That is now all fixed, though at a (low)
> > price. Because the magic is now gone, we think it is even clearer than is
> > was before. The difference is you have to tell Border where to add the
> child
> > component. Whether it will be added to
> <wicket:border>..</wicket:border>which is called the "border", or <span
> > wicket:id="myBorder">..</span> which called the "border body". And
> because
> > the body can be wrapped by a container such as a Form, you need to add
> > (move) the body to the wrapper component via
> > wrapper.add(getBodyContainer()) if needed. By doing so you create a clean
> > component hierarchy with no more magic and ambiguities and transparent
> > resolvers.
> >
> > border.addToBorder() and border.addToBorderBody() can be used to
> > explicitly tell where to add the child. border.add() will add it the
> body.
> >
> > see Border javadoc as well
> > Component rendering
> >
> > We used to have different entry points to render a Page, a Component for
> a
> > web request and a Component for an AJAX request. That is history.
> Whenever
> > you want to render a component, simply call component.render().
> >
> > You may recall that Component.render(MarkupStream) already existed and
> thus
> > in most cases (e.g. IComponentResolvers implementations) you simply need
> to
> > remove the markupStream parameter.
> >
> > The markup fragment which is still needed to render a Component is
> > retrieved via Component.getMarkup(). Most components will ask their
> parent
> > container to find it via MarkupContainer.getMarkup(Component child).
> >
> > IMarkupFragment is a new concept introduced. A markup fragment is what is
> > says: a fragment of markup taken from a larger resource (file). Please
> see
> > the javadoc on when it is better to subclass getMarkup() and when
> > getMarkup(Component).
> >
> > Component.getMarkup() successfully returns a result as soon as it is
> > connected (add) to a parent with an associated markup resource (file).
> Note
> > that this usually is not in the component constructor, since the
> component
> > itself will not yet been added to its parent.
> >
> > You may recall that until now you very carefully had to forward the
> markup
> > stream to the next suitable position. That has been simplified as well.
> > Every component will use its own markup stream and the parent container
> is
> > responsible to position it while rendering its child components.
> >
> > On the same topic: onRender(MarkupStream) has been changed to onRender();
> > no more MarkupStream. You can get for every component once you called
> > render() via getMarkupStream().
> > UTF-8 encoded property files
> >
> > If you are using Java 6 or newer, than Wicket will be configured to use
> java.util.Properties#load(Reader(in,
> > "utf-8")) for files with "*.utf8.properties" extension.
> > TabbedPanel
> >
> > - ITab.getPanel() now returns WebMarkupContainerWithAssociatedMarkup
> > instead of Panel so it is now possible to create tabs using Fragments
> or
> > Panels rather then just Panels.
> > - TabbedPanel.setSelectedTab() is now chainable
> > - TabbedPanel now takes a List<? extends ITab> rather then List<ITab>
> >
> > MarkupContainer.isTransparentResolver() removed
> >
> > We removed MarkupContainer.isTransparentResolver() in favor of the more
> > general IComponentResolver. To make transition easy, we provide a
> > TransparentWebMarkupContainer. In cases where
> > TransparentWebMarkupContainer doesn't work for you, please see
> > TransparentWebMarkupContainer on how to achieve the same effect with your
> > component.
> >
> > Different than MarkupContainer.isTransparentResolver() where the
> > component's id wasn't needed in the component's path, with
> > IComponentResolver it must be included. Imagine you used to have a
> > transparent container <body wicket:id="myBody">, you were able to access
> a
> > label from the Page just by "myLabel". With the change, you must use
> > "myBody:myLabel".
> > IComponentResolver.resolve API has changed
> >
> > Until now, with IComponentResolver.resolve() is was your responsibility
> to
> > render the component. You returned true, if the component was found and
> > rendered. That was because we had different means to render the component
> > and wicket itself was not able to judge which one to use. That has
> changed
> > and thus we were able to change the IComponentResolver.resolve API. With
> > the revised API, you simply return the resolved component and wicket core
> > knows what to do with it. It made Wicket's internal code simpler and
> > hopefully yours as well.
> > Wicket-IOC changes
> >
> > InjectorHolder.getInjector().inject(Object object) is replaced with
> > org.apache.wicket.injection.Injector.get().inject(Object object).
> > This is valid for both Wicket-Spring and Wicket-Guice.
> >
> > Wicket-Guice's InjectionFlagCachingGuiceComponentInjector is removed. The
> > replacement is GuiceComponentInjector. The caching mechanism that
> > InjectionFlagCachingGuiceComponentInjector provided is moved to
> > org.apache.wicket.injection.Injector so that the caching is re-used for
> both
> > Wicket-Spring and Wicket-Guice.
> > Wicket-Guice no more supports method injection. The same could be
> achieved
> > with field injection. This way it is the same as Wicket-Spring and the
> > involved code is highly reused between the IOC projects.
> > Visitors
> >
> > Visitors have been cleaned up. Dependency on magic return values defined
> in
> > Component#IVisitor have been replaced with a Component#IVisit object that
> > allows the visitor to control the flow of the traversal.
> >
> > formComponent.visitChildren(Radio.class, new IVisitor<Component>()
> > {
> > public /*[1]*/ Object component(Component component /*[2]*/)
> > {
> > if (value.equals(component.getDefaultModelObject()))
> > {
> >
> addFormComponentValue(formComponent,((Radio<?>)component).getValue());
> > return STOP_TRAVERSAL; /*[3]*/
> > }
> > return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER; /*[4]*/
> > }
> > });
> >
> > formComponent.visitChildren(Radio.class, new IVisitor<Component, Void>()
> > {
> > public void /*[1]*/ component(final Component component, final
> IVisit<Void> visit /*[2]*/)
> > {
> > if (value.equals(component.getDefaultModelObject()))
> > {
> >
> addFormComponentValue(formComponent,((Radio<?>)component).getValue());
> > visit.stop(); /*[3]*/
> > }
> > else
> > {
> > visit.dontGoDeeper(); /*[4]*/
> > }
> > }
> > });
> >
> > [1] The new style visitor no longer returns a value, instead the value
> > can be returned using visit.stop(value)
> > [2] The new visit object is introduced to control the visitor traversal
> > [3] Instead of relying on magic return values the traversal is stopped by
> > using the new visit object
> > [4] Same as [3] but a different method on IVisit is used
> > Component Initialization - Component#onInitialize
> >
> > A new callback method was added to Component class - onInitialize(). This
> > method is intended to provide an alternate place to initialize the
> component
> > in addition to standard constructors. The advantage of using this method
> > over a constructor is that when it is invoked the Page and the markup of
> the
> > component are both available and so a more complex initialization can
> take
> > place.
> >
> > Before this method was introduced the developer had to rely on using
> > onBeforeRender() method with some kind of
> "has-already-been-called-or-not"
> > check to make sure the initialization code has only been run a single
> time.
> > onInitialize() has this guarantee baked in - it will only be called once
> > during the lifetime of the component.
> > Request parameters
> >
> > To get the current request parameters (for example in Ajax behavior
> > processing) in Apache Wicket 1.4:
> >
> > String parameterValue =
> RequestCycle.get().getRequest().getParameter(parameterName);
> >
> > In 1.5 you have a better control where the parameter comes from:
> >
> > // GET request StringValue parameterValue =
> RequestCycle.get().getRequest().getQueryParameters().getParameterValue(parameterName);
> >
> > // POST request StringValue parameterValue =
> RequestCycle.get().getRequest().getPostParameters().getParameterValue(parameterName);
> >
> > Or if you don't care about the method:
> >
> > StringValue parameterValue =
> RequestCycle.get().getRequest().getRequestParameters().getParameterValue(parameterName);
> >
> > Switching to/from secured communication over https
> >
> > In 1.4 a custom IRequestCycleProcessor is needed:
> >
> > public class MyApplication extends WebApplication
> > {
> > @Override
> > protected IRequestCycleProcessor newRequestCycleProcessor()
> > {
> > return new HttpsRequestCycleProcessor(new HttpsConfig());
> > }
> > }
> >
> > In 1.5 this is re-implemented with the new HttpsMapper:
> >
> > public class MyApplication extends WebApplication
> > {
> > @Override
> > public void init()
> > {
> > super.init();
> >
> > setRootRequestMapper(new
> HttpsMapper(getRootRequestMapper(), new HttpsConfig()));
> > }
> > }
> >
> > Registering HttpsMapper as a root mapper will check all pages before
> > rendering for annotation @RequireHttps.
> > HeaderContribution
> >
> > In 1.4 a custom HeaderContributor needed:
> >
> > new HeaderContributor(new IHeaderContributor() {
> >
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > public void renderHead(IHeaderResponse response) {
> > //your logic goes here }
> > });
> >
> > This could be substitute with:
> >
> > new AbstractHeaderContributor() {
> >
> > @Override
> > public void renderHead(IHeaderResponse response) {
> > //your logic goes here }
> > };
> >
> > Component and IBehavior implement IHeaderContributor
> >
> > Prior to 1.5 IHeaderContributor was used as a mixin for components and
> > behaviors that wanted to write to the header, in 1.5 it is no longer
> > necessary to implement the interface directly because both Component and
> > IBehavior implement it.
> > Removed HeaderContributor and friends.
> >
> > HeaderContributor was a convenience that did not add much and actually
> made
> > things worst by increasing memory footprint in a lot of cases. Instead we
> > can simply override IHeaderContributor#renderHead(IHeaderResponse) and
> > achieve the same functionality in a simpler and consistent fashion.
> >
> > Wicket 1.4:
> >
> > public class MyPage extends WebPage {
> > public MyPage() {
> > add(HeaderContributor.forJavaScript(YuiLib.class,
> "yahoo-dom-event/yahoo-dom-event.js"));
> > add(HeaderContributor.forCss(AbstractCalendar.class,
> "assets/skins/sam/calendar.css"));
> > }
> > }
> >
> > Becomes the following in 1.5:
> >
> > public class MyPage extends WebPage {
> > public MyPage() {
> > }
> > public void renderHead(IHeaderResponse response) {
> > response.renderJavascriptReference(new
> PackageResourceReference(YuiLib.class,
> > "yahoo-dom-event/yahoo-dom-event.js"));
> > response.renderCSSReference(new
> PackageResourceReference(AbstractCalendar.class,
> > "assets/skins/sam/calendar.css"));
> > }
> > }
> >
> > Likewise,
> >
> > public class MyPage extends WebPage {
> > public MyPage() {
> > WebMarkupContainer c=new WebMarkupContainer();
> > c.add(HeaderContributor.forJavaScript(YuiLib.class,
> "yahoo-dom-event/yahoo-dom-event.js"));
> > add(c);
> > }
> > }
> >
> > becomes
> >
> > public class MyPage extends WebPage {
> > public MyPage() {
> > WebMarkupContainer c=new WebMarkupContainer();
> > c.add(new AbstractBehavior() {
> > public void renderHead(IHeaderResponse response) {
> > response.renderJavascriptReference(new
> PackageResourceReference(YuiLib.class,
> > "yahoo-dom-event/yahoo-dom-event.js"));
> > }
> > });
> > add(c);
> > }
> > }
> >
> > RequestCycle
> >
> > RequestCycle has changed in 1.5-M1 and WebRequestCycle has been removed.
> >
> > When we want to override RequestCycle's methods and write our logic codes
> > we can not do it like 1.4.x.
> >
> > eg.
> > *ReqeustCycle*
> >
> > public MyRequestCycle extends WebRequestCycle {
> > @Override
> > public void onBeginRequest() {
> > //... }
> >
> > @Override
> > public void onEndRequest() {
> > //... }
> >
> > @Override
> > public Page onRuntimeException(Page page, RuntimeException e) {
> > // ... }
> > }
> >
> > In this case we'll need to extend RequestCycle and Override
> >
> org.apache.wicket.Application.setRequestCycleProvider(IRequestCycleProvider)
> > to return our a provider for a custom RequestCycle implementation.
> > Exception handling
> >
> > In Wicket 1.4 it was needed to extend
> > org.apache.wicket.RequestCycle.onRuntimeException(Page,
> RuntimeException).
> > Wicket 1.5 gives even better control, by overriding
> > org.apache.wicket.Application.newExceptionMapper() it is possible to
> change
> > even the default processing of error pages.
> > ImageMap removed
> >
> > ImageMap was deprecated in 1.4.11 and in 1.5 it was replaced with
> > ClientSideImageMap component
> > getResourceSettings().setAddLastModifiedTimeToResourceReferenceUrl() has
> > been replaced
> >
> > With https://issues.apache.org/jira/browse/WICKET-3028 and
> > https://issues.apache.org/jira/browse/WICKET-3021 this method was
> > replaced. The timestamp, which previously was added as a query parameter
> to
> > the resource url is now part of the file's basename (the name part before
> > the extension). This has several advantages and gives you best possible
> > caching support. See for example chapter
> >
> > Use fingerprinting to dynamically enable caching
> >
> > in
> >
> > http://code.google.com/intl/de-DE/speed/page-speed/docs/caching.html
> >
> > The feature is enabled by default so unless you want to disable it with
> > getResourceSettings().setUseTimestampOnResources(boolean) or query its
> > state with getResourceSettings().getUseTimestampOnResources() you usually
> > don't have to care about it at all. Timestamping only works when the
> > ResourceReference supports a last modified timestamp and returns a
> non-null
> > timestamp for method ResourceReference.getLastModified(). This is always
> > true for package resources and wicket:link.
> > Inter-component events
> >
> > Wicket 1.5 offers a simple, yet flexible, way for component to
> communicate
> > with each other in a decoupled manner. The two major interfaces that
> > facilitate this are:
> >
> > /**
> > * Objects that can send events
> > *
> > * @author Igor Vaynberg (ivaynberg)
> > */public interface IEventSource
> > {
> > /**
> > * Sends an event
> > *
> > * @param <T>
> > * tyep of payload
> > *
> > * @param sink
> > * object that will receive the event
> > * @param broadcast
> > * if the object that receives the event needs to
> broadcast it to others, this is the
> > * type of broadcast that should be used
> > * @param payload
> > * event payload
> > */
> > <T> void send(IEventSink sink, Broadcast broadcast, T payload);
> > }
> >
> > and
> >
> > /**
> > * Objects that can receive events
> > *
> > * @author Igor Vaynberg (ivaynberg)
> > */public interface IEventSink
> > {
> > /**
> > * Called when an event is sent to this sink
> > *
> > * @param event
> > */
> > void onEvent(IEvent<?> event);
> > }
> >
> > .
> >
> > The classes that implement these interfaces, and can thus participate in
> > the event mechanism are: Component, RequestCycle, Session, and
> Application.
> >
> > The mechanism allows for different event broadcast methods defined here:
> >
> > /**
> > * Defines the event broadcast type.
> > *
> > * @author igor
> > */public enum Broadcast {
> > /**
> > * Breadth first traversal. Supported sinks in order of traversal:
> > *
> > * <ol>
> > * <li>{@link Application}</li>
> > * <li>{@link Session}</li>
> > * <li>{@link RequestCycle}</li>
> > * <li>{@link Page}</li>
> > * <li>{@link Component}s</li>
> > * </ol>
> > *
> > * Any sink along the path can be specified and traversal will
> start with the specified sink as
> > * root, eg:
> > *
> > * <ul>
> > * <li>If a component inside the page is specified then only the
> component and all its children
> > * will receive the event</li>
> > * <li>If Session is specified then the session, the request cycle,
> the page and all its
> > * components will receive the event</li>
> > * </ul>
> > */
> > BREADTH,
> > /**
> > * Depth first traversal. Supported sinks in order of traversal:
> > *
> > * <ol>
> > * <li>{@link Component}s</li>
> > * <li>{@link Page}</li>
> > * <li>{@link RequestCycle}</li>
> > * <li>{@link Session}</li>
> > * <li>{@link Application}</li>
> > * </ol>
> > *
> > * Any sink along the path can be specified and traversal will
> start with the specified sink as
> > * root, eg:
> > *
> > * <ul>
> > * <li>If a component inside the page is specified then only the
> component and all its children
> > * will receive the event</li>
> > * <li>If Session is specified then the session, the request cycle,
> the page and all its
> > * components will receive the event</li>
> > * </ul>
> > *
> > */
> > DEPTH,
> > /**
> > * A bubble-up traversal. In a bubble-up traversal only the sink
> and its parents are notified.
> > *
> > * Supported sinks in order of traversal are:
> > * <ol>
> > * <li>{@link Component}s</li>
> > * <li>{@link Page}</li>
> > * <li>{@link RequestCycle}</li>
> > * <li>{@link Session}</li>
> > * <li>{@link Application}</li>
> > * </ol>
> > *
> > * Any sink along the path can be specified and traversal will
> start at the specified sink and
> > * work its way up to the {@link Application}, eg:
> > *
> > * <ul>
> > * <li>If a component inside the page is specified then only the
> component, its parents, the
> > * request cycle, the session, and the application will be
> notified.
> > * <li>If Session is specified then the session, the application
> will be notified</li>
> > * </ul>
> > */
> > BUBBLE,
> > /**
> > * Only the specified sink receives the event
> > */
> > EXACT;
> > }
> >
> > There is an example in wicket-examples which demonstrates the usage of
> > this.
> > List of renamed classes and methods
> > 1.4 1.5 org.apache.wicket.request.resource.ResourceReference
> org.apache.wicket.request.resource.PackageResourceReference
> org.apache.wicket.RedirectToUrlException
> org.apache.wicket.request.flow.RedirectToUrlException
> org.apache.wicket.Request org.apache.wicket.request.Request
> org.apache.wicket.RequestCycle org.apache.wicket.request.cycle.RequestCycle
> org.apache.wicket.RequestCycle.urlFor
> org.apache.wicket.request.cycle.RequestCycle.renderUrlFor
> org.apache.wicket.util.lang.Objects.cloneObject(Object)
> org.apache.wicket.util.lang.WicketObjects.cloneObject(Object)
> org.apache.wicket.protocol.http.WebRequest
> org.apache.wicket.request.http.WebRequest
> org.apache.wicket.protocol.http.WebResponse
> org.apache.wicket.request.http.WebResponse
> org.apache.wicket.request.target.basic.RedirectRequestTarget
> RedirectRequestHandler
> org.apache.wicket.request.target.coding.QueryStringUrlCodingStrategy use
> PageParameters.getNamedParameter(String) with any IRequestHandler
> org.apache.wicket.request.http.WebRequest.getHttpServletRequest()
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.getHttpServletRequest()
> > org.apache.wicket.protocol.http.WebApplication.newWebResponse(final
> > HttpServletResponse) (missing)
> org.apache.wicket.Application.set(Application)
> org.apache.wicket.ThreadContext.setApplication(Application)
> org.apache.wicket.protocol.http.BufferedWebResponse.BufferedWebResponse(HttpServletResponse)
> >
> org.apache.wicket.protocol.http.BufferedWebResponse.BufferedWebResponse(WebResponse)
> > org.apache.wicket.PageParameters
> org.apache.wicket.request.mapper.parameter.PageParameters
> PageParameters.put(String, String)
> org.apache.wicket.request.mapper.parameter.PageParameters.setNamedParameter(String,
> > Object) org.apache.wicket.protocol.http.HttpSessionStore
> org.apache.wicket.session.HttpSessionStore
> org.apache.wicket.protocol.http.WebApplication.newSessionStore() (missing,
> HttpSessionStore is the only supported)
> org.apache.wicket.markup.html.resources.CompressedResourceReference
> org.apache.wicket.request.resource.CompressedResourceReference
> org.apache.wicket.markup.html.resources.JavascriptResourceReference
> org.apache.wicket.request.resource.JavascriptResourceReference
> org.apache.wicket.markup.html.image.Image.Image(String) (this constructor
> is protected in 1.5, as replacement can be used
> > NonCachingImage(String))
> org.apache.wicket.markup.html.image.resource.DynamicImageResource
> org.apache.wicket.request.resource.DynamicImageResource
> org.apache.wicket.util.convert.ConverterLocator
> org.apache.wicket.ConverterLocator org.apache.wicket.util.lang.Objects
> org.apache.wicket.util.lang.WicketObjects
> org.apache.wicket.protocol.http.WebApplication.sessionDestroyed(String)
> org.apache.wicket.protocol.http.WebApplication.sessionUnbound(String)
> org.apache.wicket.protocol.https.HttpsRequestCycleProcessor
> org.apache.wicket.protocol.https.HttpsMapper
> org.apache.wicket.PageParameters.getInt(String)
> org.apache.wicket.request.mapper.parameter.PageParameters.getNamedParameter(String).toInt()
> org.apache.wicket.protocol.http.WebRequestCycle.newBrowserInfoPage(String)
> > org.apache.wicket.protocol.http.WebSession.newBrowserInfoPage(String)
> org.apache.wicket.protocol.http.WebApplication.newWebRequest(HttpServletRequest)
> >
> org.apache.wicket.protocol.http.WebApplication.newWebRequest(HttpServletRequest,
> > String)
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletResponse)
> >
> org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletRequest,
> > HttpServletResponse)
> org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String,
> > Class) org.apache.wicket.protocol.http.WebApplication.mountPage(String,
> > Class)
> com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> > String)
> com.fredhopper.bm.application.BMLocalizer.loadStringResource(Component,
> > String, Locale, String, String)
> > Change Notification Preferences<
> https://cwiki.apache.org/confluence/users/viewnotifications.action>
> > View Online<
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5>|
> View
> > Changes<
> https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=2853449&revisedVersion=53&originalVersion=52>|
> Add
> > Comment<
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5?showComments=true&showCommentArea=true#addcomment
> >
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.4 increases type safety for web applications
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8
>