Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added chapters and moved around questions, no other changes

...

Panel
borderStylesolid
titleTable of contents
Table of Contents
minLevel2

Maven

How do I skip the tests when doing a Maven build?

...

Other information about building wicket can be found on the Wicket from source page.

Is Wicket available in the central Maven 2 repository?

Yes, it is. However, we must rely on the Maven project to update their repository with the latest releases, resulting in some lag. If you need them hot and fresh, you can use the wicket-stuff's Maven 2 repository by adding the the following to your project's pom.xml:

Code Block
xml
xml

<repositories>
    <repository>
      <id>org.wicketstuff</id>
      <name>Wicket Stuff Repo</name>
      <url>http://wicketstuff.org/maven/repository</url>
    </repository>
  </repositories>

Working with the Wicket API

Why are so many methods final?

...

A "two-phase init" is a pattern that deals with this and other use cases. The big downside to that pattern is that you have to transfer all your constructor arguments into fields so they can be accessed by the second phase' init method, and for a framework concerned with size of the objects this does not mesh very well. It also adds a lot more code you have to write. so as far as making this change in Wicket we won't do that. Moreover, it is simple enough to add a private init() into your basepage and forward both constructors to it.

How do I add custom error pages (like Page Expired)?

In your application class that extends WebApplication, set the following in the init() method:

Code Block
java
java

getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class);
getApplicationSettings().setAccessDeniedPage(MyAccessDeniedPage.class);
getApplicationSettings().setInternalErrorPage(MyInternalErrorPage.class);

There are also some other neat settings you should check out in getApplicationSettings(), getDebugSettings(), getExceptionSettings(), getMarkupSettings(), getPageSettings(), getRequestCycleSettings(), getSecuritySettings and getSessionSettings(). See the javadoc for more information.

If calling setInternalErrorPage, make sure to also call:
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);

How can I have images/files uploaded to and downloaded from my wicket app?

In short, use the wicket.markup.html.form.upload.FileUploadField component in your form (set as multiPart) in order to allow file uploads. Use an implementation of the wicket.markup.html.DynamicWebResource to provide downloads of the content. For a longer description with examples see UploadDownload

The view layer, markup etc.

My markup element does not get rendered

...

has no body, onComponentBody() isn't called and nothing is rendered!

What do you look like?

You can see some of the Wicket committers in action at the Wicket gathering in 2005 in Deventer, Holland. You'll see Eelco, Johan, Juergen, Martijn and Jonathan, and emeritus committer Chris.

What is the meaning of life, the universe and everything?

42

How can I change the location of Markup files?

...

Yes. See Control where HTML files are loaded from

How can I have images/files uploaded to and downloaded from my wicket app?

In short, use the wicket.markup.html.form.upload.FileUploadField component in your form (set as multiPart) in order to allow file uploads. Use an implementation of the wicket.markup.html.DynamicWebResource to provide downloads of the content. For a longer description with examples see UploadDownload

Is Wicket available in the central Maven 2 repository?

Yes, it is. However, we must rely on the Maven project to update their repository with the latest releases, resulting in some lag. If you need them hot and fresh, you can use the wicket-stuff's Maven 2 repository by adding the the following to your project's pom.xml:

...


<repositories>
    <repository>
      <id>org.wicketstuff</id>
      <name>Wicket Stuff Repo</name>
      <url>http://wicketstuff.org/maven/repository</url>
    </repository>
  </repositories>

More on the view: AJAX

I get errors when I use Ajax in Opera Browser (before Version Beta 9 of Opera)

If you want to use wicket's Ajax implementation with Opera Browser you have to do

Code Block

Application.getMarkupSettings().setStripWicketTags(true);

to get it work.

Because of a Bug which is in all Opera Browsers before Version 9 Beta, the ajax stuff will not work with wicketTags enabled.

Keywords:
Opera Ajax Wicket Strip wicket:id

Which browsers have been tested with Wicket AJAX?

To test it use the AJAX examples and the AJAX request header test.

  • Internet Explorer 6 and 7
  • Firefox 1.5
  • Firefox 2.0
  • Safari 2.0.1 - 2.0.4
  • Opera 8.54 (linux)
  • Opera 9 (linux)
  • Konqueror 3.5.2 (most of the examples works, but the Todo list example makes the browser crash)

Wicket community

What do you look like?

You can see some of the Wicket committers in action at the Wicket gathering in 2005 in Deventer, Holland. You'll see Eelco, Johan, Juergen, Martijn and Jonathan, and emeritus committer Chris.

Miscellaneous

What is the meaning of life, the universe and everything?

42

Deployment

How do I add custom error pages (like Page Expired)?

In your application class that extends WebApplication, set the following in the init() method:

...


getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class);
getApplicationSettings().setAccessDeniedPage(MyAccessDeniedPage.class);
getApplicationSettings().setInternalErrorPage(MyInternalErrorPage.class);

There are also some other neat settings you should check out in getApplicationSettings(), getDebugSettings(), getExceptionSettings(), getMarkupSettings(), getPageSettings(), getRequestCycleSettings(), getSecuritySettings and getSessionSettings(). See the javadoc for more information.

...

My application says "DEVELOPMENT MODE", how do I switch to production?

...

Code Block
if (DEVELOPMENT.equalsIgnoreCase(configurationType))
{
    log.info("You are in DEVELOPMENT mode");
    getResourceSettings().setResourcePollFrequency(Duration.ONE_SECOND);
    getDebugSettings().setComponentUseCheck(true);
    getDebugSettings().setSerializeSessionAttributes(true);
    getMarkupSettings().setStripWicketTags(false);
    getExceptionSettings().setUnexpectedExceptionDisplay(
                    UnexpectedExceptionDisplay.SHOW_EXCEPTION_PAGE);
    getAjaxSettings().setAjaxDebugModeEnabled(true);
}
else if (DEPLOYMENT.equalsIgnoreCase(configurationType))
{
    getResourceSettings().setResourcePollFrequency(null);
    getDebugSettings().setComponentUseCheck(false);
    getDebugSettings().setSerializeSessionAttributes(false);
    getMarkupSettings().setStripWicketTags(true);
    getExceptionSettings().setUnexpectedExceptionDisplay(
                    UnexpectedExceptionDisplay.SHOW_INTERNAL_ERROR_PAGE);
    getAjaxSettings().setAjaxDebugModeEnabled(false);
}

I get

...

'

...

Code Block

Application.getMarkupSettings().setStripWicketTags(true);

to get it work.

Because of a Bug which is in all Opera Browsers before Version 9 Beta, the ajax stuff will not work with wicketTags enabled.

Keywords:
Opera Ajax Wicket Strip wicket:id

I get 'Internal error cloning object' errors

...

Answer provided courtesy Igor Vaynberg

Which browsers have been tested with Wicket AJAX?

To test it use the AJAX examples and the AJAX request header test.

...

Versioning

Wicket stores versions of pages to support the browser's back button. Because this concept is difficult to understand, we'll present a simple use case that describes the problem and how versioning helps.

...