You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by zh...@163.com on 2008/03/05 10:30:41 UTC
Re:getPageParameters() NullPointer
hello,i got the same problem.
PageParameters params = new PageParameters();
params.put("pid", pid);
this.setResponsePage(FirstLogin.class,
new PageParameters(params));
--------in FirstLogin.java -------
PageParameters params = new PageParameters();
System.out.print("pid=" + params.getKey("pid"));------the output is null;how to get the parameter?
在2008-01-22,"Stephan Koch" <st...@sk-dev.de> 写道:
Hi all,
I'm experiencing a problem using getPageParameters().
The parameter id is passed to MyPage:
setResponsePage(MyPage.class, new PageParameters("id="+evalId));
In the constructor of MyPage I try to access the parameter id:
Integer evalId = Integer.parseInt(getPageParameters().getKey("id"));
This fails with a NullPointerException. I thought the usage of
PageParameters was pretty straightforward- did I miss something here?
I'm using Wicket 1.3.
Regards,
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: getPageParameters() NullPointer
Posted by Johan Compagner <jc...@gmail.com>.
>
>
> --------in FirstLogin.java -------
> PageParameters params = new PageParameters();
> System.out.print("pid=" + params.getKey("pid"));------the output is
> null;how to get the parameter?
What are you doing here exactly?
Are you creating the PageParameters yourself?? in the FirstLogin page?
That is wrong. You should use the PageParameter constructor
johan
RE: RE: getPageParameters() NullPointer
Posted by Maeder Thomas <th...@ecofin.ch>.
Yes there is, it's in Page.java at line 319
> -----Original Message-----
> From: zhangjunfeng21@163.com [mailto:zhangjunfeng21@163.com]
> Sent: Donnerstag, 6. März 2008 03:11
> To: users@wicket.apache.org
> Subject: Re:RE: getPageParameters() NullPointer
>
> thanks,but there is no method of "Page.getPageParameters()",
> how to use it ? may you show me in detial ?
>
>
>
>
>
>
>
> Stephan, what you want is not PageParameters.getKey("id"),
> but PageParameters.getInt("id");
>
>
> > PageParameters params = new PageParameters();
> System.out.print("pid="
> > + params.getKey("pid"));------the output is null
>
> yes, the output is null, you just created a new, empty page
> parameters object. use Page.getPageParameters()
>
> Thomas
>
>
>
> > Sent: Mittwoch, 5. März 2008 10:31
> > To: users@wicket.apache.org
> > Subject: Re:getPageParameters() NullPointer
> >
> > hello,i got the same problem.
> >
> > PageParameters params = new PageParameters();
> > params.put("pid", pid);
> > this.setResponsePage(FirstLogin.class,
> > new PageParameters(params));
> >
> > --------in FirstLogin.java -------
> > PageParameters params = new PageParameters();
> System.out.print("pid="
> > + params.getKey("pid"));------the output is null;how to get the
> > parameter?
> >
> >
> >
> > Hi all,
> >
> > I'm experiencing a problem using getPageParameters().
> >
> > The parameter id is passed to MyPage:
> > setResponsePage(MyPage.class, new PageParameters("id="+evalId));
> >
> > In the constructor of MyPage I try to access the parameter id:
> > Integer evalId = Integer.parseInt(getPageParameters().getKey("id"));
> >
> > This fails with a NullPointerException. I thought the usage of
> > PageParameters was pretty straightforward- did I miss
> something here?
> >
> > I'm using Wicket 1.3.
> >
> > Regards,
> > Stephan
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re:RE: getPageParameters() NullPointer
Posted by zh...@163.com.
thanks,but there is no method of "Page.getPageParameters()", how to use it ? may you show me in detial ?
Stephan, what you want is not PageParameters.getKey("id"), but PageParameters.getInt("id");
> PageParameters params = new PageParameters();
> System.out.print("pid=" + params.getKey("pid"));------the output is null
yes, the output is null, you just created a new, empty page parameters object. use Page.getPageParameters()
Thomas
> Sent: Mittwoch, 5. März 2008 10:31
> To: users@wicket.apache.org
> Subject: Re:getPageParameters() NullPointer
>
> hello,i got the same problem.
>
> PageParameters params = new PageParameters();
> params.put("pid", pid);
> this.setResponsePage(FirstLogin.class,
> new PageParameters(params));
>
> --------in FirstLogin.java -------
> PageParameters params = new PageParameters();
> System.out.print("pid=" + params.getKey("pid"));------the
> output is null;how to get the parameter?
>
>
>
> Hi all,
>
> I'm experiencing a problem using getPageParameters().
>
> The parameter id is passed to MyPage:
> setResponsePage(MyPage.class, new PageParameters("id="+evalId));
>
> In the constructor of MyPage I try to access the parameter id:
> Integer evalId = Integer.parseInt(getPageParameters().getKey("id"));
>
> This fails with a NullPointerException. I thought the usage
> of PageParameters was pretty straightforward- did I miss
> something here?
>
> I'm using Wicket 1.3.
>
> Regards,
> Stephan
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
RE: getPageParameters() NullPointer
Posted by Maeder Thomas <th...@ecofin.ch>.
Stephan, what you want is not PageParameters.getKey("id"), but PageParameters.getInt("id");
@zhangjunfeng:
> PageParameters params = new PageParameters();
> System.out.print("pid=" + params.getKey("pid"));------the output is null
yes, the output is null, you just created a new, empty page parameters object. use Page.getPageParameters()
Thomas
> -----Original Message-----
> From: zhangjunfeng21@163.com [mailto:zhangjunfeng21@163.com]
> Sent: Mittwoch, 5. März 2008 10:31
> To: users@wicket.apache.org
> Subject: Re:getPageParameters() NullPointer
>
> hello,i got the same problem.
>
> PageParameters params = new PageParameters();
> params.put("pid", pid);
> this.setResponsePage(FirstLogin.class,
> new PageParameters(params));
>
> --------in FirstLogin.java -------
> PageParameters params = new PageParameters();
> System.out.print("pid=" + params.getKey("pid"));------the
> output is null;how to get the parameter?
>
>
> 在2008-01-22,"Stephan Koch" <st...@sk-dev.de> 写道:
>
> Hi all,
>
> I'm experiencing a problem using getPageParameters().
>
> The parameter id is passed to MyPage:
> setResponsePage(MyPage.class, new PageParameters("id="+evalId));
>
> In the constructor of MyPage I try to access the parameter id:
> Integer evalId = Integer.parseInt(getPageParameters().getKey("id"));
>
> This fails with a NullPointerException. I thought the usage
> of PageParameters was pretty straightforward- did I miss
> something here?
>
> I'm using Wicket 1.3.
>
> Regards,
> Stephan
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>