protected Constructors

Did you ever try to create an instance of a class with a protected constructor from outside its package? I ran into this need when working with JPA-Entities of which i wanted to know initial field values. (yeah, i know. kind of black magic…) It is actually easier, than getting protected Fields:  Java |  copy |? public static <t> [...]

AnchoredBookmarkablePageLink

Another Wicket Gem. Obvious but helpful.  Java |  copy |? import org.apache.wicket.PageParameters;import org.apache.wicket.markup.ComponentTag;import org.apache.wicket.markup.html.link.BookmarkablePageLink;import org.apache.wicket.model.IModel; /*** @author Thijs Vonk**/public class AnchoredBookmarkablePageLink extends BookmarkablePageLink {  private static final long serialVersionUID = 1L;  private IModel stringAnchor;  public AnchoredBookmarkablePageLink(String id, Class pageClass, IModel anchor) { super(id, pageClass); this.stringAnchor = anchor; }  public AnchoredBookmarkablePageLink(String id, Class pageClass, PageParameters params, IModel anchor) { super(id, pageClass, [...]

Ever heard of asynchronous Exceptions?

Really weird, what Heinz Kabutz digs out of the java language Read this newsletter to find out, how System.otu.println(“foo”) can throw a SQLException His statement on checked and unchecked seems rather incomplete, though: My personal opinion is that checked exceptions are not as useful as we would hope. For example, the class java.io.IOException has 74 [...]

An old discussion, but never too old

From an Email conversation this evening: what do you think about it? For a while, I was “all flame” about Checked exceptions, but then I read about their limitations (which are why they aren’t included in C#, more about it there : http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88421.aspx ) and since I wonder what’s the best solution. i was all [...]

Maven Eclipse Integration

As a happy Q4E User, i did not waste too much time lately on keeping an eye on the other maven-eclipse-integration projects. Now i stumbled upon this wiki page showing a very detailed feature comparison matrix between the usual suspects. One thing that stroke me is, that m2eclipse is proposed at eclipse.org as well as [...]

Article about Wicket vs. Tapestry 5

The article is about Tapestry 4.1, not v5 as mentioned in the title. Some say, Tapestry can compare with Wicket. And from a certain perspective, they’re obviously right. In case you have not made up your mind yet, this developerworks article might help you. In there is a thorough side-by-side comparison of tapestry against wicket. [...]

Wicket and AJAX

Here is an interesting interview with three of the wicket committers (or, should i say legends, personal heros …) about how Wicket hides the complexity of AJAX-related JavaScript coding from the productive programmer: Learning JavaScript is not hard, what is hard is learning FireFox JavaScript, IE6 JavaScript, IE7 JavaScript, Opera JavaScript, WebKit JavaScript, etc. The [...]

Wicket, Guice and java.lang.reflect.Type

if there is anyone suffering from https://issues.apache.org/jira/browse/WICKET-1403 , i added a quick hack to make it possible to restart the server while persisting the application’s state. not a final solution, but it works for now and makes the development cycle much faster (for me) The Problem is, that java.lang.reflect.Type is not Serializable right now. The [...]

Wicket DropDownChoice with eye-candy

thinking twice, ajax-indicators are not at all eye-candy, but useful from an usablity perspective.  Java |  copy |? /** * Adds an AJAX-Indicator to DropDownChoice * @author Eyal Golan */class DropDownChoiceWithAjaxIndicator extends DropDownChoice implements IAjaxIndicatorAware{ private static final long serialVersionUID = 1365817942506006686L; private final WicketAjaxIndicatorAppender indicatorAppender = new WicketAjaxIndicatorAppender();  public DropDownChoiceWithAjaxIndicator(final String id, final IModel choices, final IChoiceRenderer renderer, final MarkupContainer markupContainer) [...]

Wicket SecureForm

posted by mighty Igor on the Wicket-User list: Here is a simple demonstration of how to prevent “Cross-Site Request Forgery”  Java |  copy |? /** * Form that uses a random uuid token in order to prevent nasty people from messing around (also known as cross site request forgery) ;)  * @author igor vaynberg */class SecureForm extends Form{ public SecureForm(final String id) [...]

Wicket Breadcrumbs

This template for using a Breadcrumb-like Navigation really shows the beauty of stateful pages that separate wicket from those countless template-based frameworks.  Java |  copy |? /** * Provides a list of Breadcrumbs. THIS IS ONLY A TEMPLATE. DO NOT USE UNMODIFIED * @author igor vaynberg */public abstract class BreadcrumbPage extends Page{ private List<breadcrumbpage> history = new ArrayList</breadcrumbpage><breadcrumbpage>();  public BreadcrumbPage() { add(new [...]

Wicket DropDownIdChoice

This one is all about id <-> object mapping when using DropDowns:  Java |  copy |? /** * @author igor vaynberg */public class DropDownIdChoice extends DropDownChoice{  public DropDownIdChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer, Class<?> type) { super(id, model, choices, renderer); setType(type); }  @Override public String getModelValue() { final Object id = getModelObject(); if (id != null) { return getConverter(getType()).convertToString(id, [...]

Wicket ResubmitSafeForm

Another little gem: /** * Form that divides submit-events to inital and resubmit. * @author igor vaynberg */ abstract class ResubmitSafeForm extends Form { private boolean submitted; private static final long serialVersionUID = 1L; public ResubmitSafeForm(final String id) { super(id); } public ResubmitSafeForm(final String id, final IModel model) { super(id, model); } protected abstract void [...]

Wicket TextLink

Another very simple, yet incredibly helpful snippet: /** * Simple Link that renders its Model as a textual body * @author Al Maw */ abstract class TextLink extends Link { public TextLink(final String id, final IModel model) { super(id, model); } @Override protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { // Draw anything before [...]

Back to Resin

while this blog happily ran on glassfish v1 for quite some time now, i have to admit switching back to caucho resin. the reason for this is simple: i will be using resin at work soon again, so any detailed experience with glassfish (at least with anything <v3) will be void. i worked with resin2 [...]

Wicket Gems

it happens quite often that, while browsing the Wicket mailing list, i stumble upon gems, that i fail to find or even remember when i could use them. this really has to stop the problem is: there is of course no commen theme about these hacks, components, behaviours etc, so it is very hard to [...]

Wicket-CSSMenu

i just released a simple css-menu component for wicket as a preview.as always, your’re very welcome to send any kind of criticism.

Warp-persist

i recently wrote an article on Warp-persist , an excellent framework for integrating JPA with Guice. This article can be found here .

Q4E

The lovely Q4E-Eclipse plugin has been updated to version 0.5. New and noteworthy can be found here . You can use this update site to install it. Particularly the new “Analyze Dependencies” View is awesome!

Wicket, Guice and persistent PageStore

I filed another guice related issue at Wicket’s Jira https://issues.apache.org/jira/browse/WICKET-1403 . Seems, the injection stuff needs some treatment before the ultra-fast-turnaround development environment will come true. Let’s hope for the best.

Google charts as Wicket component

If you do not have a problem sending Data to Google (some have) and you don’t want to create fancy charts for your wicket application yourself, this component can save you a significant amount of time.Thanks to Daniel Spiewak for sharing this.

Colder deployment

If you happen to face the well known hot-deployment issue of OOMs due to a full Permanent Generation, it is likely that you use something, that keeps hold of your Classes, so that the webapp-classloader cannot be GC’d correctly. This is a wellknown but hard to find & fix issue very many configurations suffer from.The [...]

Java Reflection

I just wrote a library that (de-)serializes command objects after transmitting over network. Before executing, i’d like to (re-)inject members annotated with Guices @Inject annotation. I did some Reflection before, but never felt the needed to get hold of private fields, which is now essential.It’s not a big deal, but in case anyone could use [...]

Artifactory

Artifactory 1.2.5 was released. Find changes here .I’m a big fan of this software, even though they used AJAX much more than convienient in the interface. If you’re using maven, you should really give it a spin. Here’s why: It lets you define WHAT to get from WHICH repository.Afaik, this is a unique feature. The [...]

Rails? yeah, right….

just found this on DIGG: I recently converted a Rails site to Wicket. Wicket really cuts down on template spaghetti code. I can honestly say that wicket’s OO approach is the right way of doing things for web application development. If anyone is interested in the site I mentioned, http://fabulously40.com/

Wicket 1.3

In case you did not notice it yet: Wicket 1.3 was released today

Q4E very promising

Frequent readers know, that i use maven2 and eclipse and i am very happy with it. There is a an eclipse plugin for maven that generates classpaths from the dependency graph, as well as a plugin for eclipse, that makes adding a dependency to the pom very easy.One flaw existed for me though, that made [...]

Guice AutoBind

Please note, that i released just another piece of free software: Guice-AutoBind.It is used to complement guices @ImplementedBy annotation in order to easily bulk-bind whole implementation packages. More…

TagCloud

Please note, that there is a TagCloud component for Wicket in Beta stage. Please send Feedback if you use it.

Lightbox integration with Wicket 1.1-beta

I just put Lightbox for Wicket 1.1-beta online. Though this is a preview/beta release, i’d love to get some feedback. New ‘features’ (or bugfixes if you consider a lack thereof a bug ) are: basic IModel support AJAX-supportand few fixes. Grab it here

Maven aggregators

Here’s a pit i fell into few days ago: I am a happy maven2 user. I use aggregator projects to manage the different parts of a project in different sub-projects, and provide a single-entry to building all of them. Imagine project X with modules x-services, x-webapp, x-ejb and x-ear with welldefined dependencies among each other. [...]

Wicket LazyInitProxyFactory

i fell over a subtle bug in Wicket-IOC, that causes RuntimeException when Wicket-Guice is used together with Guice-bound-Interceptors while Injecting non-Interface Classes. While the above usecase is a terribly rare one, this problem shows that it is not always a good idea to copy a required lib to another package in order to have ‘no [...]

OSS

From now on, i’m going to release a few little spare-time-software projects. The first is a simple Wicket-Component written to integrate the famous Lightbox2 JavaScript into Wicket Components/Pages. It can be found here

HisKit, MyKit, YourKit is for anyone

When it comes to profiling applications, one of the most important feature to me is the ability to focus on what is important. The problem with Memdumps and Thread-traces is, that you’ll immediately face much more information you can handle, and the tool’s ability of helping you on your way drilling down through the data [...]

Object construction

Did you read “Effective Java”? If you didn’t, you should: it is one of the greatest book about java i have read so far. The only problem with this book is that – over time – you tend to forget some of the invaluable advices, you get from it.At least, this happened to me: I [...]