Basic Wicket Layout

classic Classic list List threaded Threaded
2 messages Options
yka
Reply | Threaded
Open this post in threaded view
|

Basic Wicket Layout

yka
This post has NOT been accepted by the mailing list yet.
Hi all,

I just followed the example on http://wicket.apache.org/learn/examples/markupinheritance.htm. There, for the base class it says "Note that the abstract keyword isn’t required, but considered a good practise."
After starting Tomcat and trying to start the application I get
"Last cause: null WicketMessage: Can't instantiate page using constructor 'public com.index.BasePage()'. Might be it doesn't exist, may be it is not visible (public)" When I mark the class as non abstract then the error message is gone.
Why has Wicket problems with abstract classes?
Who can help?

Cheers,
Y
Reply | Threaded
Open this post in threaded view
|

Re: Basic Wicket Layout

Hans Lesmeister 2
This post has NOT been accepted by the mailing list yet.
Hi yka,

yka wrote
Why has Wicket problems with abstract classes?
Wicket does not have problems with abstract classes. if you do something like setResponsePage(SomeAbstractPage.class) then an error like that will happen. Instead you should setResponsePage(RealPage.class) (where RealPage inherits SomeAbstractPage).

Same applies to other places where a Class-Parameter is needed (i.e. Application.getHomePage)

Please, show some code.
--
Regards,
Hans

http://cantaa.de