0

I wrote a wicket application using wicket archetype in wicket.apache.org But when I added my code, it didn't accept my pages and throw a run time exception:

Last cause: Class org.apache.wicket.session.DefaultPageFactory can not access a member of class ece.se.noodle.ui.login.LoginPage with modifiers ""

WicketMessage: Can't instantiate page using constructor 'ece.se.noodle.ui.login.LoginPage()'. An exception has been thrown during construction!

I extends my pages from wicket WebPage and use RestartResponseAtInterceptPageException for redirecting to LoginPage. But neither DashbordPage nor LoginPage can be loaded.

Can someone please tell me where did I did wrong? Or what should I do to fix it?

Fezo
  • 183
  • 2
  • 14

1 Answers1

0

You probably missed page/request lifecycle. If you require user to log in use AuthenticatedWebApplication instead and annotation based strategy.

If you throws RestartResponseAtInterceptPageException directly you could implement a wrong condition when to throw that exception. E.g. if you is not signed in, throw the exception, if the user is already signed (it is usually a flag in session), do not throw the exception.

See authentication examples on http://www.wicket-library.com/wicket-examples-6.0.x/index.html

Martin Strejc
  • 4,307
  • 2
  • 23
  • 38