NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
2008 has started with a bang...
Wicket 1.3
has been released. In
his blog
, Martijn Dashorst (pictured right), chairman of the project and a senior software developer at Web application development firm Topicus, has announced and outlined the features of the new release. (The
Wicket Homepage
also lists all the new 1.3 features.) The 1.3 release sees Wicket moving from SourceForge to Apache, together with a host of new features and improvements. To introduce them to us, we talk to Martijn himself.
Martijn, first, can you quickly tell us what Wicket is?
Apache Wicket is an open source web framework. Wicket aims to simplify developing web applications in Java by providing a first class component-oriented programming model, similar to JSF and .Net. Wicket components consist of just Java and HTML.
Wicket's HTML templates are devoid of template logic: all markup manipulation is performed in Java code. This enforces a strong separation of concerns: HTML can be crafted by designers, the backing logic by Java developers.
But Apache Wicket is more than just a framework. Adopting Wicket will not only give you a compelling web framework, but also one of the most supportive and active Java communities. We are very fortunate that such a positive community has surrounded our framework.
Why and how did you become an Apache project in the first place? What are the gains for the end user? And for you and the other project owners?
We were looking for a new home in 2006 after several outages on the SourceForge infrastructure and excessive spam on the mailing lists. When we started discussing our future, Apache Member Alex Karasulu asked us whether we wanted to join Apache and, after some initial fears, we became convinced it would be in the best interest of both Wicket and Apache that we should join forces.
Wicket would be joining one of the best and most friendly open source communities around, and Apache would gain yet another, but very fast growing, Java web framework. The Wicket community was already open and meritocracy-based, so the match in culture already existed.
For Wicket users, the move to Apache will mean more continuity in the development and support of Wicket. The Apache foundation is very good at fostering sustainable, diverse and open communities.
Another benefit is that the Apache license is very business friendly. We have cleaned up our code base to remove non-Apache compatible code. So it is safe to build your business on, if you care about licensing.
The biggest difference between Apache and SourceForge, though, is that Apache is a community, while SourceForge is a hosting provider with no community aspects (apart from the annual awards ceremony). I never gave that much thought, but attending ApacheCon really opened my eyes
as to what "Community" actually means.
Another thing that struck me is that since we became part of Apache, the number of job listings increased dramatically. So the Apache brand is really helpful for adoption of the framework, and I expect to see considerable growth going forward.
There are also some downsides to becoming part of Apache. We were almost a top 10 project at SourceForge, and we had pretty good insight in the number of downloads, though with the increased usage of Maven, that was already a skewed statistic. Due to the nature of Apache's mirroring system we can't reliably count downloads at the moment.
Being part of Apache also gave the advantage of sharing
infrastructure. Running your own infrastructure is no picnic and we are glad that the infra team at Apache is taking good care of that. To me, one of the biggest advantages of the Apache infrastructure is that the amount of spam messages has gone down to 0 on our lists (though we have to moderate some of it).
Now, Wicket 1.3 has just been released. Can you give us a rundown of the highlights?
Now that we are an official Apache project, we have sifted through the code and removed all of it that isn't compatible with the Apache License. The code base is now fully Apache License compatible. For instance, we replaced the old JavaScript date picker component (which was LGPL licensed) with the YUI calendar (which is BSD licensed).
Moving to Apache also required us to rename our packages to "org.apache.wicket", so start your auto-import refactoring tool to update the Wicket imports!
Plus, we switched our logging implementation from commons-logging to slf4j.
There have been simplifications in several areas. The models API (the glue between Wicket components and domain objects) has been simplified and is now considered stable (though we will be applying generics in the next release). The converter API (for converting between request
parameters and domain values) has been simplified and is now considered stable. The validators API (for validating form input) has been simplified, and decoupled from form components to make them usable outside Wicket.
The number of callback methods for the request processing has been reduced: a lot of cluttered internal methods (onInternalAttach, onInternalBeforeRender) and the odd callback method have been removed (e.g. Component#onAttach).
We have added support for Google Guice, the alternative dependency injection framework.
We now provide a filter implementation for Wicket applications to improve serving non-Wicket content, and have Wicket applications run from the root of the web application context. The old servlet is still supported though (and necessary for some application servers that
won't work with the filter).
Wicket's portlet support now provides a way to use your Wicket pages directly in portal containers as portlets, without having to write additional code, or maintain a separate hierarchy. Ate Douma has presented this (much) improved support on the Wicket community meetup in Amsterdam and demonstrated Wicket's examples running in a JetSpeed portal.
Wicket's URL mounting (used to create REST-like URL's to pages) received a great addition with the HybridUrlCodingStrategy. The mount point is preserved even after invoking listener interfaces (thus you don't lose bookmarkability after clicking links) and that for AJAX
only pages the state is preserved on refresh. This enables links like these:
http://example.com/mount/path/param1/value1
http://example.com/mount/path/param1/value1.3
If you want to learn more about the changes for migrating your existing application, we have a
migration guide
.
Can you share some code snippets to highlight how things were done before and how they're done now?
As an example of the model API changes, let's implement a link that performs some action on a person:
add(new Link("save", new Model(person)) {
publicvoid onClick() {
Person p = (Person)getModel().getObject(null);
p.save();
}
});
The getModel().getObject(null) will retrieve the person from the link component. The null parameter is typed as a Component and confused a lot of beginning Wicket programmers as to its purpose. Therefore we removed that parameter, and the code becomes as follows:
add(new Link("save", new Model(person)) {
publicvoid onClick() {
Person p = (Person)getModel().getObject();
p.save();
}
});
In doing so, we also pruned the model hierarchy from rarely used classes.
Injecting your components with Spring services is achieved by annotating your service with @SpringBean at the location where you want it to be injected:
publicclass SpringApplication extends Application
{
@Override
protectedvoid init()
{
addComponentInstantiationListener(new SpringComponentInjector(this));
}
/**
* @see org.apache.wicket.Application#getHomePage()
*/
public Class getHomePage()
{
return HomePage.class;
}
}
publicclass HomePage extends WebPage {
@SpringBean IMyService service;
public MyPage() {
Person p = service.getPerson(123);
add(new Label("name", p.getName()))
}
}
The guice integration is strikingly similar:
publicclass GuiceApplication extends Application
{
@Override
protectedvoid init()
{
addComponentInstantiationListener(new GuiceComponentInjector(this));
}
/**
* @see org.apache.wicket.Application#getHomePage()
*/
public Class getHomePage()
{
return HomePage.class;
}
}
publicclass HomePage extends WebPage {
@Inject IMyService service;
public MyPage() {
Person p = service.getPerson(123);
add(new Label("name", p.getName()))
}
}
What are your two personal favorite enhancements/changes in this release?
The simplifications done to the API's. They make developing Wicket applications much simpler. I also like the fact that those API's are now pretty much stable (the models, converter and validation API's). I don't see much that can be improved in those interfaces, apart from adopting Java 5 generics.
The hybrid URL encoding in Wicket 1.3 is really great.
thoof.com
, for instance, uses it on their site.
Wicket has seen a rapidly growing level of adoption. Can you give us some statistics to illustrate this?
Since we joined Apache, job listings for Wicket have gone up exponentially (though in absolute terms it is still low), and actually go against the trend where demand for Java and .Net developers is languishing (last quarter of 2007 shows a serious decline in
demand for Java/JSF developers
).
E-mail traffic on our mailing list is also one of the highest in the Java landscape. According to the archives at Nabble (
here
and
here
), we are ranked above all other web frameworks, are the top project at Apache, and only have NetBeans and java.net (two very large umbrella projects) above us.
Our IRC channel is constantly populated with ~60 folks.
And finally there are a lot of community efforts erupting across the world. San Francisco enjoyed a Wicket community meeting, London has an event each month and last November we had a very well attended Wicket meeting in Amsterdam, attended by >80 people from the Netherlands, Belgium and Germany.
You also have a book coming out. But there are also other books about Wicket, right? How does yours differ to those?
Wicket in Action
is written by two core members (Eelco and myself) who have been involved with Wicket from the start, so you get the knowledge straight from the source. Wicket in Action targets Wicket 1.3, whereas the currently available book (
Pro Wicket
) targets Wicket 1.2.
Wicket in Action is published by Manning, a publisher that is known for authoritative and high quality books enabling developers to become highly productive. The editing process Eelco and I have to endure is tough, but ultimately will benefit our readers... and it shows. Early reviews coming from the Early Access program are very positive.
By the way, there is another book being written by Kent Tong, author of "Enjoying Web Development with Tapestry", which is aptly named "Enjoying Web Development with Wicket". I haven't read it, but from the snippets I have seen, it is the same as his Tapestry book, but then implemented using Wicket.
What can we expect from Wicket, going forward?
The next version of Wicket will break away from JDK 1.4 and be based completely on Java 5. We will introduce type-safe models by generifying them. This makes, for instance, constructing a DropDownChoice component easier. Currently the constructor reads as follows:
This confuses developers because you can't see what needs to go into those models (especially when you don't have the source or Javadoc attached to your project.) However, using generics will make it clearer, even without Javadoc and source:
Probably one of the bigger API breaks will be the change of IDataProvider's size() return type: it will align with the JPA standard of returning a long instead of an integer.
One other thing that will receive some attention is the testing side of Wicket. We currently have a very capable framework to test your Wicket components in isolation and exercise your pages. But with Java 5, we can really make the API work nicely. We are looking at utilizing a JUnit 4/Hamcrest type of assertions. We're also keeping an eye on JDave (a Behavioral Driven Development test framework) and might steal some ideas from that framework as well.
Other ideas that we might adopt are a security sub project (integrating Wicket Swarm/Wasp, currently hosted at sourceforge), possibly integrate a JavaScript animation framework into the core (or extensions) to make rich application development with basic Wicket components much easier. The full list of wishes for 1.4 can be found
here
.
If anyone wants to suggest new avenues of development, they are welcome to discuss them on our development list, or propose them on our Wicket 1.4 wish list.
The number of callback methods for the request
> processing has been reduced: a lot of cluttered
> internal methods (onInternalAttach,
> onInternalBeforeRender) and the odd callback method
> have been removed (e.g. Component#onAttach).
Can you please explain what you did to avoid having to expose these internal methods? I have run into similar problems with my own designs.
On the topic of the HybridUrlCodingStrategy I note that every single time you click on the "thoof" icons in the top left of http://thoof.com/ the URL number increments. That is: http://thoof.com/home.1http://thoof.com/home.2 etc.
Readable URLs are great, but stable URLs are even better because they make Wicket pages indexable by Google. Isn't there a way to provide stable URLs for Wicket?
> The number of callback methods for the request
> processing has been reduced: a lot of cluttered
> internal methods (onInternalAttach,
> onInternalBeforeRender) and the odd callback method
> have been removed (e.g. Component#onAttach).
Can you please explain what you did to avoid having to expose these internal methods? I have run into similar problems with my own designs.
Readable URLs are great, but stable URLs are even better because they make Wicket pages indexable by Google. Isn't there a way to provide stable URLs for Wicket?
> Can you please explain what you did to avoid having
> to expose these internal methods? I have run into
> similar problems with my own designs.
We added a big JavaDoc warning on top of the method: "THIS IS FOR WICKET INTERNAL USE ONLY, DO NOT CALL OR OVERRIDE".
Naming things "internal" also indicates to folks to not touch it.
And if you do override those methods, then when things break it is your own fault. You didn't read the docs, didn't follow the naming convention.
We'd rather not have had to expose these methods in the first place, and there are still methods with an internal use only. We haven't solved the problem completely...
The other thing about removing the internal methods is that we now require users to call
super.onBeforeRender()
. If they override and don't call super, we detect that and throw an exception.
@RequiresSuper sounds like a good idea in one form of another, though it isn't clear whether users must invoke it at the beginning of the method or anywhere throughout its body. However, it's not clear to me why this is even necessary in your case.
Given:
publicclass MySuperclass
{
privatevoid method1()
{
superMethod();
subMethod();
}
privatevoid superMethod()
{
// cannot be overriden
}
protectedvoid subMethod()
{
// subclasses can override this
}
}
Are you saying that the problem is that external classes want to invoke method1()?
It's sad to say that many of these problems with internal methods are a result of the lack of "friend classes" that C++ has. I'm not saying I want that feature added to Java (I don't) but I wish someone would come up with a cleaner solution.
//Readable URLs are great, but stable URLs are
//even better because they make Wicket pages indexable
//by Google. Isn't there a way to provide stable URLs
//for Wicket?
> //Readable URLs are great, but stable URLs are
> //even better because they make Wicket pages
> indexable
> //by Google. Isn't there a way to provide stable URLs
>
> //for Wicket?
>
> I am curious about this too.
There's only so much we can do without completely pinning ourselves to demanding cookies. Maybe we could use cookies instead if they are available, but that might lead to inconsistent situations. But as always, patches are welcome if you have a good idea to improve this even further.
> There's only so much we can do without completely
> pinning ourselves to demanding cookies. Maybe we
> could use cookies instead if they are available, but
> that might lead to inconsistent situations. But as
> always, patches are welcome if you have a good idea
> to improve this even further.
Why do you need to retain client state for these pages in the first place?
> Why do you need to retain client state for these
> pages in the first place?
When you use normal bookmarkable page mounting, for instance the indexed url strategy you get the normal /foo/bar URL's.
This works great, even Ajax. The problem is that the modified state on the server is gone when the user refreshes the url in the browser: all things that were changed are now gone, at least when they were only part of the page state and not stored in a database.
The reason is that the incoming request is a bookmarkable request which will result in creating the page instead of retrieving the page from our store. The new page will have its state reset.
The hybrid encoding stores the page number and ajax version in the URL and a page refresh will not recreate the page but retrieve that specific page instance, including the state.
When the hybrid url is retrieved in a different session, for instance page number 201 and that doesn't exist, the page will be treated as just a bookmarkable request. So the hybrid url combines the best of both worlds.
If I have a stable application based on Wicket 1.2, and want to upgrade to you next version that uses JDK 1.5 and generics, how important is it to upgrade to 1.3 now? Will it be much easier to upgrade in two steps, or will I just be doing double work to upgrade twice?
you should upgrade when you have the time business wise. Otherwise don't. Even though getting things to compile won't take too much time, you will probably run into runtime issues because you may have used some part in a way that triggers an unforeseen problem in the new Wicket.
We did everything we can to prevent such things from happening, but aren't omniscient.
The upgrade from 1.3 to 1.4 (or 2.0) will be less troublesome I think, as you won't have the package rename, model refactor, etc. However, the next version will break API for the IDataProvider#size() method to align with JPA's count queries (which is a long instead of a int).
Note that my experience is converting a 150+ page (with a similar number of panels and custom components) application from Wicket 1.2 to 1.3 so your mileage may vary. It took us quite some time to move everything over as we had a lot of custom models, which broke with the simplification in 1.3.
Apache Wicket 1.3 Released
URL: Wicket
At 6:00 AM on Jan 4, 2008, Geertjan wrote:
Fresh Jobs for Developers Post a job opportunity

2008 has started with a bang... Wicket 1.3 has been released. In his blog , Martijn Dashorst (pictured right), chairman of the project and a senior software developer at Web application development firm Topicus, has announced and outlined the features of the new release. (The Wicket Homepage also lists all the new 1.3 features.) The 1.3 release sees Wicket moving from SourceForge to Apache, together with a host of new features and improvements. To introduce them to us, we talk to Martijn himself.Martijn, first, can you quickly tell us what Wicket is?
Apache Wicket is an open source web framework. Wicket aims to simplify developing web applications in Java by providing a first class component-oriented programming model, similar to JSF and .Net. Wicket components consist of just Java and HTML.
Wicket's HTML templates are devoid of template logic: all markup manipulation is performed in Java code. This enforces a strong separation of concerns: HTML can be crafted by designers, the backing logic by Java developers.
But Apache Wicket is more than just a framework. Adopting Wicket will not only give you a compelling web framework, but also one of the most supportive and active Java communities. We are very fortunate that such a positive community has surrounded our framework.
Why and how did you become an Apache project in the first place? What are the gains for the end user? And for you and the other project owners?
We were looking for a new home in 2006 after several outages on the SourceForge infrastructure and excessive spam on the mailing lists. When we started discussing our future, Apache Member Alex Karasulu asked us whether we wanted to join Apache and, after some initial fears, we became convinced it would be in the best interest of both Wicket and Apache that we should join forces.
Wicket would be joining one of the best and most friendly open source communities around, and Apache would gain yet another, but very fast growing, Java web framework. The Wicket community was already open and meritocracy-based, so the match in culture already existed.
For Wicket users, the move to Apache will mean more continuity in the development and support of Wicket. The Apache foundation is very good at fostering sustainable, diverse and open communities.
Another benefit is that the Apache license is very business friendly. We have cleaned up our code base to remove non-Apache compatible code. So it is safe to build your business on, if you care about licensing.
The biggest difference between Apache and SourceForge, though, is that Apache is a community, while SourceForge is a hosting provider with no community aspects (apart from the annual awards ceremony). I never gave that much thought, but attending ApacheCon really opened my eyes as to what "Community" actually means.
Another thing that struck me is that since we became part of Apache, the number of job listings increased dramatically. So the Apache brand is really helpful for adoption of the framework, and I expect to see considerable growth going forward.
There are also some downsides to becoming part of Apache. We were almost a top 10 project at SourceForge, and we had pretty good insight in the number of downloads, though with the increased usage of Maven, that was already a skewed statistic. Due to the nature of Apache's mirroring system we can't reliably count downloads at the moment.
Being part of Apache also gave the advantage of sharing infrastructure. Running your own infrastructure is no picnic and we are glad that the infra team at Apache is taking good care of that. To me, one of the biggest advantages of the Apache infrastructure is that the amount of spam messages has gone down to 0 on our lists (though we have to moderate some of it).
Now, Wicket 1.3 has just been released. Can you give us a rundown of the highlights?
Now that we are an official Apache project, we have sifted through the code and removed all of it that isn't compatible with the Apache License. The code base is now fully Apache License compatible. For instance, we replaced the old JavaScript date picker component (which was LGPL licensed) with the YUI calendar (which is BSD licensed).
Moving to Apache also required us to rename our packages to "org.apache.wicket", so start your auto-import refactoring tool to update the Wicket imports!
Plus, we switched our logging implementation from commons-logging to slf4j.
There have been simplifications in several areas. The models API (the glue between Wicket components and domain objects) has been simplified and is now considered stable (though we will be applying generics in the next release). The converter API (for converting between request parameters and domain values) has been simplified and is now considered stable. The validators API (for validating form input) has been simplified, and decoupled from form components to make them usable outside Wicket.
The number of callback methods for the request processing has been reduced: a lot of cluttered internal methods (onInternalAttach, onInternalBeforeRender) and the odd callback method have been removed (e.g. Component#onAttach).
We have added support for Google Guice, the alternative dependency injection framework.
We now provide a filter implementation for Wicket applications to improve serving non-Wicket content, and have Wicket applications run from the root of the web application context. The old servlet is still supported though (and necessary for some application servers that won't work with the filter).
Wicket's portlet support now provides a way to use your Wicket pages directly in portal containers as portlets, without having to write additional code, or maintain a separate hierarchy. Ate Douma has presented this (much) improved support on the Wicket community meetup in Amsterdam and demonstrated Wicket's examples running in a JetSpeed portal.
Wicket's URL mounting (used to create REST-like URL's to pages) received a great addition with the HybridUrlCodingStrategy. The mount point is preserved even after invoking listener interfaces (thus you don't lose bookmarkability after clicking links) and that for AJAX only pages the state is preserved on refresh. This enables links like these:
If you want to learn more about the changes for migrating your existing application, we have a migration guide .
Can you share some code snippets to highlight how things were done before and how they're done now?
As an example of the model API changes, let's implement a link that performs some action on a person:
add(new Link("save", new Model(person)) { public void onClick() { Person p = (Person)getModel().getObject(null); p.save(); } });The getModel().getObject(null) will retrieve the person from the link component. The null parameter is typed as a Component and confused a lot of beginning Wicket programmers as to its purpose. Therefore we removed that parameter, and the code becomes as follows:
add(new Link("save", new Model(person)) { public void onClick() { Person p = (Person)getModel().getObject(); p.save(); } });In doing so, we also pruned the model hierarchy from rarely used classes.
Injecting your components with Spring services is achieved by annotating your service with @SpringBean at the location where you want it to be injected:
public class SpringApplication extends Application { @Override protected void init() { addComponentInstantiationListener(new SpringComponentInjector(this)); } /** * @see org.apache.wicket.Application#getHomePage() */ public Class getHomePage() { return HomePage.class; } } public class HomePage extends WebPage { @SpringBean IMyService service; public MyPage() { Person p = service.getPerson(123); add(new Label("name", p.getName())) } }The guice integration is strikingly similar:
public class GuiceApplication extends Application { @Override protected void init() { addComponentInstantiationListener(new GuiceComponentInjector(this)); } /** * @see org.apache.wicket.Application#getHomePage() */ public Class getHomePage() { return HomePage.class; } } public class HomePage extends WebPage { @Inject IMyService service; public MyPage() { Person p = service.getPerson(123); add(new Label("name", p.getName())) } }What are your two personal favorite enhancements/changes in this release?
The simplifications done to the API's. They make developing Wicket applications much simpler. I also like the fact that those API's are now pretty much stable (the models, converter and validation API's). I don't see much that can be improved in those interfaces, apart from adopting Java 5 generics.
The hybrid URL encoding in Wicket 1.3 is really great. thoof.com , for instance, uses it on their site.
Wicket has seen a rapidly growing level of adoption. Can you give us some statistics to illustrate this?
Since we joined Apache, job listings for Wicket have gone up exponentially (though in absolute terms it is still low), and actually go against the trend where demand for Java and .Net developers is languishing (last quarter of 2007 shows a serious decline in demand for Java/JSF developers ).
E-mail traffic on our mailing list is also one of the highest in the Java landscape. According to the archives at Nabble ( here and here ), we are ranked above all other web frameworks, are the top project at Apache, and only have NetBeans and java.net (two very large umbrella projects) above us.
Our IRC channel is constantly populated with ~60 folks.
And finally there are a lot of community efforts erupting across the world. San Francisco enjoyed a Wicket community meeting, London has an event each month and last November we had a very well attended Wicket meeting in Amsterdam, attended by >80 people from the Netherlands, Belgium and Germany.
You also have a book coming out. But there are also other books about Wicket, right? How does yours differ to those?
Wicket in Action is written by two core members (Eelco and myself) who have been involved with Wicket from the start, so you get the knowledge straight from the source. Wicket in Action targets Wicket 1.3, whereas the currently available book ( Pro Wicket ) targets Wicket 1.2.
Wicket in Action is published by Manning, a publisher that is known for authoritative and high quality books enabling developers to become highly productive. The editing process Eelco and I have to endure is tough, but ultimately will benefit our readers... and it shows. Early reviews coming from the Early Access program are very positive.
By the way, there is another book being written by Kent Tong, author of "Enjoying Web Development with Tapestry", which is aptly named "Enjoying Web Development with Wicket". I haven't read it, but from the snippets I have seen, it is the same as his Tapestry book, but then implemented using Wicket.
What can we expect from Wicket, going forward?
The next version of Wicket will break away from JDK 1.4 and be based completely on Java 5. We will introduce type-safe models by generifying them. This makes, for instance, constructing a DropDownChoice component easier. Currently the constructor reads as follows:
This confuses developers because you can't see what needs to go into those models (especially when you don't have the source or Javadoc attached to your project.) However, using generics will make it clearer, even without Javadoc and source:
Here it is much clearer what needs to go where.
Probably one of the bigger API breaks will be the change of IDataProvider's size() return type: it will align with the JPA standard of returning a long instead of an integer.
One other thing that will receive some attention is the testing side of Wicket. We currently have a very capable framework to test your Wicket components in isolation and exercise your pages. But with Java 5, we can really make the API work nicely. We are looking at utilizing a JUnit 4/Hamcrest type of assertions. We're also keeping an eye on JDave (a Behavioral Driven Development test framework) and might steal some ideas from that framework as well.
Other ideas that we might adopt are a security sub project (integrating Wicket Swarm/Wasp, currently hosted at sourceforge), possibly integrate a JavaScript animation framework into the core (or extensions) to make rich application development with basic Wicket components much easier. The full list of wishes for 1.4 can be found here .
If anyone wants to suggest new avenues of development, they are welcome to discuss them on our development list, or propose them on our Wicket 1.4 wish list.
14 replies so far (
Post your own)
Re: Apache Wicket 1.3 Released
Congrats for the most beautiful framework. Give us the book too. With pictures.Re: Apache Wicket 1.3 Released
>The number of callback methods for the request > processing has been reduced: a lot of cluttered > internal methods (onInternalAttach, > onInternalBeforeRender) and the odd callback method > have been removed (e.g. Component#onAttach). Can you please explain what you did to avoid having to expose these internal methods? I have run into similar problems with my own designs. On the topic of the HybridUrlCodingStrategy I note that every single time you click on the "thoof" icons in the top left of http://thoof.com/ the URL number increments. That is: http://thoof.com/home.1 http://thoof.com/home.2 etc. Readable URLs are great, but stable URLs are even better because they make Wicket pages indexable by Google. Isn't there a way to provide stable URLs for Wicket?
Re: Apache Wicket 1.3 Released
[reposting because of JavaLobby bug(?)]> The number of callback methods for the request
> processing has been reduced: a lot of cluttered
> internal methods (onInternalAttach,
> onInternalBeforeRender) and the odd callback method
> have been removed (e.g. Component#onAttach).
Can you please explain what you did to avoid having to expose these internal methods? I have run into similar problems with my own designs.
On the topic of the HybridUrlCodingStrategy I note that every single time you click on the "thoof" icons in the top left of http://thoof.com/ the URL number increments. That is: http://thoof.com/home.1 http://thoof.com/home.2 etc.
Readable URLs are great, but stable URLs are even better because they make Wicket pages indexable by Google. Isn't there a way to provide stable URLs for Wicket?
Re: Apache Wicket 1.3 Released
> Can you please explain what you did to avoid having> to expose these internal methods? I have run into
> similar problems with my own designs.
We added a big JavaDoc warning on top of the method: "THIS IS FOR WICKET INTERNAL USE ONLY, DO NOT CALL OR OVERRIDE".
Naming things "internal" also indicates to folks to not touch it.
And if you do override those methods, then when things break it is your own fault. You didn't read the docs, didn't follow the naming convention.
We'd rather not have had to expose these methods in the first place, and there are still methods with an internal use only. We haven't solved the problem completely...
The other thing about removing the internal methods is that we now require users to call
super.onBeforeRender(). If they override and don't call super, we detect that and throw an exception.Java could need a @RequiresSuper annotation
Re: Apache Wicket 1.3 Released
@RequiresSuper sounds like a good idea in one form of another, though it isn't clear whether users must invoke it at the beginning of the method or anywhere throughout its body. However, it's not clear to me why this is even necessary in your case.Given:
public class MySuperclass { private void method1() { superMethod(); subMethod(); } private void superMethod() { // cannot be overriden } protected void subMethod() { // subclasses can override this } }Are you saying that the problem is that external classes want to invoke method1()?
It's sad to say that many of these problems with internal methods are a result of the lack of "friend classes" that C++ has. I'm not saying I want that feature added to Java (I don't) but I wish someone would come up with a cleaner solution.
Re: Apache Wicket 1.3 Released
//Readable URLs are great, but stable URLs are//even better because they make Wicket pages indexable
//by Google. Isn't there a way to provide stable URLs
//for Wicket?
I am curious about this too.
Re: Apache Wicket 1.3 Released
> //Readable URLs are great, but stable URLs are> //even better because they make Wicket pages
> indexable
> //by Google. Isn't there a way to provide stable URLs
>
> //for Wicket?
>
> I am curious about this too.
There's only so much we can do without completely pinning ourselves to demanding cookies. Maybe we could use cookies instead if they are available, but that might lead to inconsistent situations. But as always, patches are welcome if you have a good idea to improve this even further.
Re: Apache Wicket 1.3 Released
> There's only so much we can do without completely> pinning ourselves to demanding cookies. Maybe we
> could use cookies instead if they are available, but
> that might lead to inconsistent situations. But as
> always, patches are welcome if you have a good idea
> to improve this even further.
Why do you need to retain client state for these pages in the first place?
Re: Apache Wicket 1.3 Released
> Why do you need to retain client state for these> pages in the first place?
When you use normal bookmarkable page mounting, for instance the indexed url strategy you get the normal /foo/bar URL's.
This works great, even Ajax. The problem is that the modified state on the server is gone when the user refreshes the url in the browser: all things that were changed are now gone, at least when they were only part of the page state and not stored in a database.
The reason is that the incoming request is a bookmarkable request which will result in creating the page instead of retrieving the page from our store. The new page will have its state reset.
The hybrid encoding stores the page number and ajax version in the URL and a page refresh will not recreate the page but retrieve that specific page instance, including the state.
When the hybrid url is retrieved in a different session, for instance page number 201 and that doesn't exist, the page will be treated as just a bookmarkable request. So the hybrid url combines the best of both worlds.
Re: Apache Wicket 1.3 Released
What happens if you don't have AJAX? Do you end up with a stable URL? That is, can I click on:1) Home
2) Favorites
3) Home <-- end up with the same URL as #1?
Re: Apache Wicket 1.3 Released
Then you can just use the indexed url encoding strategy and you will get the desired URLs.Re: Apache Wicket 1.3 Released
If I have a stable application based on Wicket 1.2, and want to upgrade to you next version that uses JDK 1.5 and generics, how important is it to upgrade to 1.3 now? Will it be much easier to upgrade in two steps, or will I just be doing double work to upgrade twice?Re: Apache Wicket 1.3 Released
Following this release, went ahead and purchased the Manning book. (http://manning.com/dashorst/). It's really helpful. Thanks a lot.Re: Apache Wicket 1.3 Released
you should upgrade when you have the time business wise. Otherwise don't. Even though getting things to compile won't take too much time, you will probably run into runtime issues because you may have used some part in a way that triggers an unforeseen problem in the new Wicket.We did everything we can to prevent such things from happening, but aren't omniscient.
The upgrade from 1.3 to 1.4 (or 2.0) will be less troublesome I think, as you won't have the package rename, model refactor, etc. However, the next version will break API for the IDataProvider#size() method to align with JPA's count queries (which is a long instead of a int).
Note that my experience is converting a 150+ page (with a similar number of panels and custom components) application from Wicket 1.2 to 1.3 so your mileage may vary. It took us quite some time to move everything over as we had a lot of custom models, which broke with the simplification in 1.3.
added project migration part
Message was edited by: Martijn Dashorst