looks like the constructor with PageParameters is still being called instead of the default Home() constructor
Caused by: wicket.WicketRuntimeException: Can't instantiate page using
constructor public oz.web.html.portal.Home (wicket.PageParameters) and
argument
i think this is an incorrect behaviour. if no page params are specified the default constructor should be used.
-Igor
On 1/13/06,
pepone pepone <[EMAIL PROTECTED]> wrote:
This not works for me with wicket-wicket-1.2-20060108
I changue my code to this
public Home()
{
PageParameters params=new PageParameters();
params.put("page","Home");
params.put("action","view");
params.put("node","/homeDocument.html");
init(params);
}
public Home(PageParameters params) {
init(params);
}
public void init(PageParameters params) {
add(mainMenu=new MainMenu("MainMenu"));
add(searchPanel=new SearchPanel("SearchPanel"));
add(homeView=new HomeView("HomeView"));
}
now when i go to
http://localhost:8080/oz-portal/app?bookmarkablePage=oz.web.html.portal.Home&action="">
page rendres ok
but when go to http://localhost:8080/oz-portal/app i get this exception
wicket.WicketRuntimeException: Could not create home page
at wicket.request.compound.DefaultRequestTargetResolverStrategy.resolveHomePageTarget(DefaultRequestTargetResolverStrategy.java :334)
at wicket.request.compound.DefaultRequestTargetResolverStrategy.resolve(DefaultRequestTargetResolverStrategy.java:101)
at wicket.request.compound.AbstractCompoundRequestCycleProcessor.resolve(AbstractCompoundRequestCycleProcessor.java :48)
at wicket.RequestCycle.step(RequestCycle.java:951)
at wicket.RequestCycle.steps(RequestCycle.java:1057)
at wicket.RequestCycle.request(RequestCycle.java:534)
at wicket.protocol.http.WicketServlet.doGet (WicketServlet.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at org.mortbay.jetty.servlet.ServletHolder.handle (ServletHolder.java:428)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle (HttpContext.java:1530)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service (HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle (HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run (ThreadPool.java:534)
Caused by: wicket.WicketRuntimeException: Can't instantiate page using
constructor public oz.web.html.portal.Home(wicket.PageParameters) and
argument
at wicket.session.DefaultPageFactory.newPage (DefaultPageFactory.java:156)
at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:84)
at wicket.request.compound.DefaultRequestTargetResolverStrategy.resolveHomePageTarget(DefaultRequestTargetResolverStrategy.java :318)
... 21 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:142)
... 23 more
Caused by: java.lang.NullPointerException
at oz.web.html.portal.HomeView.getView(Unknown Source)
at oz.web.html.portal.WidgetStack .<init>(Unknown Source)
at oz.web.html.portal.HomeView.<init>(Unknown Source)
at oz.web.html.portal.Home.init(Unknown Source)
at oz.web.html.portal.Home.<init>(Unknown Source)
... 28 more
On 1/13/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> so something like this should work:
>
> public class Home {
> Home() {
> PageParameters default=new PageParameters();
> default.put("......
> init(default);
> }
> Home(PageParameters params) {
> init(params);
> }
>
> init(PageParameters params) {
> add(mainMenu=new MainMenu("MainMenu"));
> add(searchPanel=new
> SearchPanel("SearchPanel"));
> add(homeView=new HomeView("HomeView"));
> }
>
>
> -Igor
>
>
>
>
> On 1/13/06, pepone pepone < [EMAIL PROTECTED]> wrote:
> >
> > my Home page now is like this
> >
> > public class Home extends BasePage
> > {
> > private MainMenu mainMenu;
> > private SearchPanel searchPanel;
> > private HomeView homeView;
> > public Home()
> > {
> > add(mainMenu=new MainMenu("MainMenu"));
> > add(searchPanel=new
> SearchPanel("SearchPanel"));
> > add(homeView=new HomeView("HomeView"));
> > }
> > };
> >
> > HomeView instaciate difrent panels depending of pageParameters. and
> > depending of what panel instaciate the panel can need to read a
> > diferent parameter.
> >
> >
> >
> >
> >
> > On 1/13/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > if you need a default parameter why not set it in the default
> constructor?
> > > and have both default and pageparams constructor forward to an init
> method?
> > >
> > > -Igor
> > >
> > >
> > >
> > > On 1/13/06, pepone pepone < [EMAIL PROTECTED]> wrote:
> > > > Hello all
> > > >
> > > > is posible with wicket 1.2 set a default parameter to homePage
> > > >
> > > > thanks
> > > > --
> > > > play tetris http://pepone.on-rez.com/tetris
> > > >
> > > >
> > > >
> -------------------------------------------------------
> > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > > files
> > > > for problems? Stop! Download the new AJAX search engine that makes
> > > > searching your log files as easy as surfing the web. DOWNLOAD
> SPLUNK!
> > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > _______________________________________________
> > > > Wicket-user mailing list
> > > > [email protected]
> > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > >
> > >
> > >
> >
> >
> > --
> > play tetris http://pepone.on-rez.com/tetris
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > for problems? Stop! Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
--
play tetris http://pepone.on-rez.com/tetris
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
