You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Juan G. Arias" <ju...@gmail.com> on 2009/05/21 23:48:56 UTC
IRequestTarget not serializable
Hi all,
I want to mantain an IRequestTarget in my component, as an instance
attribute. But wicket cries about it's not serializable.
Of course, it's right. IRequestTarget is not serializable.
Why? Is something wrong with mantain a request target inside my component?
Thanks!
Juan
Re: IRequestTarget not serializable
Posted by "Juan G. Arias" <ju...@gmail.com>.
Ooook, thanks a lot!
On Fri, May 22, 2009 at 10:49 AM, James Carman <jcarman@carmanconsulting.com
> wrote:
> For me, I store a page "reference". So, as Matej suggested, you could
> have two different type of callbacks. One, a PageReferenceCallback
> and another BookmarkablePageCallback?
>
> On Fri, May 22, 2009 at 9:46 AM, Joe Fawzy <jo...@gmail.com> wrote:
> > hi dearu have to process the target during its lifecycle time and store
> that
> > result into something serializable for future use
> > so u have to make the decision during the first request where the request
> > target is valid not the second
> > joe
> >
> > On Fri, May 22, 2009 at 4:34 PM, Juan G. Arias <ju...@gmail.com>
> wrote:
> >
> >> I have this link, that I create in different ways. It performs some
> logic,
> >> and then redirects to somewhere, depending on how was created.
> >> Here is the code:
> >>
> >> class SignOutLink extends Link {
> >> private IRequestTarget target;
> >>
> >> public SignOutLink(String id, Class redirectPage) {
> >> this(id, new BookmarkablePageRequestTarget(redirectPage));
> >> }
> >>
> >> public SignOutLink(String id, String url) {
> >> this(id, new RedirectRequestTarget(url));
> >> }
> >>
> >> public SignOutLink(String id, IRequestTarget target) {
> >> super(id);
> >> this.target = target;
> >> }
> >>
> >> public void onClick() {
> >> this.signOutSession();
> >> this.redirectSignInPage();
> >> }
> >>
> >> public abstract void signOutSession();
> >>
> >> public void redirectSignInPage() {
> >> this.getRequestCycle().setRequestTarget(this.target);
> >> }
> >> }
> >>
> >>
> >> On Thu, May 21, 2009 at 8:08 PM, Matej Knopp <ma...@gmail.com>
> >> wrote:
> >>
> >> > IRequestTarget is valid only for one request. Why do you want to keep
> >> > as instance variable?
> >> >
> >> > -Matej
> >> >
> >> > On Thu, May 21, 2009 at 11:48 PM, Juan G. Arias <juangarias@gmail.com
> >
> >> > wrote:
> >> > > Hi all,
> >> > > I want to mantain an IRequestTarget in my component, as an instance
> >> > > attribute. But wicket cries about it's not serializable.
> >> > > Of course, it's right. IRequestTarget is not serializable.
> >> > >
> >> > > Why? Is something wrong with mantain a request target inside my
> >> > component?
> >> > >
> >> > > Thanks!
> >> > > Juan
> >> > >
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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: IRequestTarget not serializable
Posted by James Carman <jc...@carmanconsulting.com>.
For me, I store a page "reference". So, as Matej suggested, you could
have two different type of callbacks. One, a PageReferenceCallback
and another BookmarkablePageCallback?
On Fri, May 22, 2009 at 9:46 AM, Joe Fawzy <jo...@gmail.com> wrote:
> hi dearu have to process the target during its lifecycle time and store that
> result into something serializable for future use
> so u have to make the decision during the first request where the request
> target is valid not the second
> joe
>
> On Fri, May 22, 2009 at 4:34 PM, Juan G. Arias <ju...@gmail.com> wrote:
>
>> I have this link, that I create in different ways. It performs some logic,
>> and then redirects to somewhere, depending on how was created.
>> Here is the code:
>>
>> class SignOutLink extends Link {
>> private IRequestTarget target;
>>
>> public SignOutLink(String id, Class redirectPage) {
>> this(id, new BookmarkablePageRequestTarget(redirectPage));
>> }
>>
>> public SignOutLink(String id, String url) {
>> this(id, new RedirectRequestTarget(url));
>> }
>>
>> public SignOutLink(String id, IRequestTarget target) {
>> super(id);
>> this.target = target;
>> }
>>
>> public void onClick() {
>> this.signOutSession();
>> this.redirectSignInPage();
>> }
>>
>> public abstract void signOutSession();
>>
>> public void redirectSignInPage() {
>> this.getRequestCycle().setRequestTarget(this.target);
>> }
>> }
>>
>>
>> On Thu, May 21, 2009 at 8:08 PM, Matej Knopp <ma...@gmail.com>
>> wrote:
>>
>> > IRequestTarget is valid only for one request. Why do you want to keep
>> > as instance variable?
>> >
>> > -Matej
>> >
>> > On Thu, May 21, 2009 at 11:48 PM, Juan G. Arias <ju...@gmail.com>
>> > wrote:
>> > > Hi all,
>> > > I want to mantain an IRequestTarget in my component, as an instance
>> > > attribute. But wicket cries about it's not serializable.
>> > > Of course, it's right. IRequestTarget is not serializable.
>> > >
>> > > Why? Is something wrong with mantain a request target inside my
>> > component?
>> > >
>> > > Thanks!
>> > > Juan
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > 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: IRequestTarget not serializable
Posted by Joe Fawzy <jo...@gmail.com>.
hi dearu have to process the target during its lifecycle time and store that
result into something serializable for future use
so u have to make the decision during the first request where the request
target is valid not the second
joe
On Fri, May 22, 2009 at 4:34 PM, Juan G. Arias <ju...@gmail.com> wrote:
> I have this link, that I create in different ways. It performs some logic,
> and then redirects to somewhere, depending on how was created.
> Here is the code:
>
> class SignOutLink extends Link {
> private IRequestTarget target;
>
> public SignOutLink(String id, Class redirectPage) {
> this(id, new BookmarkablePageRequestTarget(redirectPage));
> }
>
> public SignOutLink(String id, String url) {
> this(id, new RedirectRequestTarget(url));
> }
>
> public SignOutLink(String id, IRequestTarget target) {
> super(id);
> this.target = target;
> }
>
> public void onClick() {
> this.signOutSession();
> this.redirectSignInPage();
> }
>
> public abstract void signOutSession();
>
> public void redirectSignInPage() {
> this.getRequestCycle().setRequestTarget(this.target);
> }
> }
>
>
> On Thu, May 21, 2009 at 8:08 PM, Matej Knopp <ma...@gmail.com>
> wrote:
>
> > IRequestTarget is valid only for one request. Why do you want to keep
> > as instance variable?
> >
> > -Matej
> >
> > On Thu, May 21, 2009 at 11:48 PM, Juan G. Arias <ju...@gmail.com>
> > wrote:
> > > Hi all,
> > > I want to mantain an IRequestTarget in my component, as an instance
> > > attribute. But wicket cries about it's not serializable.
> > > Of course, it's right. IRequestTarget is not serializable.
> > >
> > > Why? Is something wrong with mantain a request target inside my
> > component?
> > >
> > > Thanks!
> > > Juan
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
Re: IRequestTarget not serializable
Posted by Matej Knopp <ma...@gmail.com>.
Instead of storing requests targets you should store your own
serialized callbacks that create request targets when executed.
-Matej
On Fri, May 22, 2009 at 3:34 PM, Juan G. Arias <ju...@gmail.com> wrote:
> I have this link, that I create in different ways. It performs some logic,
> and then redirects to somewhere, depending on how was created.
> Here is the code:
>
> class SignOutLink extends Link {
> private IRequestTarget target;
>
> public SignOutLink(String id, Class redirectPage) {
> this(id, new BookmarkablePageRequestTarget(redirectPage));
> }
>
> public SignOutLink(String id, String url) {
> this(id, new RedirectRequestTarget(url));
> }
>
> public SignOutLink(String id, IRequestTarget target) {
> super(id);
> this.target = target;
> }
>
> public void onClick() {
> this.signOutSession();
> this.redirectSignInPage();
> }
>
> public abstract void signOutSession();
>
> public void redirectSignInPage() {
> this.getRequestCycle().setRequestTarget(this.target);
> }
> }
>
>
> On Thu, May 21, 2009 at 8:08 PM, Matej Knopp <ma...@gmail.com> wrote:
>
>> IRequestTarget is valid only for one request. Why do you want to keep
>> as instance variable?
>>
>> -Matej
>>
>> On Thu, May 21, 2009 at 11:48 PM, Juan G. Arias <ju...@gmail.com>
>> wrote:
>> > Hi all,
>> > I want to mantain an IRequestTarget in my component, as an instance
>> > attribute. But wicket cries about it's not serializable.
>> > Of course, it's right. IRequestTarget is not serializable.
>> >
>> > Why? Is something wrong with mantain a request target inside my
>> component?
>> >
>> > Thanks!
>> > Juan
>> >
>>
>> ---------------------------------------------------------------------
>> 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: IRequestTarget not serializable
Posted by "Juan G. Arias" <ju...@gmail.com>.
I have this link, that I create in different ways. It performs some logic,
and then redirects to somewhere, depending on how was created.
Here is the code:
class SignOutLink extends Link {
private IRequestTarget target;
public SignOutLink(String id, Class redirectPage) {
this(id, new BookmarkablePageRequestTarget(redirectPage));
}
public SignOutLink(String id, String url) {
this(id, new RedirectRequestTarget(url));
}
public SignOutLink(String id, IRequestTarget target) {
super(id);
this.target = target;
}
public void onClick() {
this.signOutSession();
this.redirectSignInPage();
}
public abstract void signOutSession();
public void redirectSignInPage() {
this.getRequestCycle().setRequestTarget(this.target);
}
}
On Thu, May 21, 2009 at 8:08 PM, Matej Knopp <ma...@gmail.com> wrote:
> IRequestTarget is valid only for one request. Why do you want to keep
> as instance variable?
>
> -Matej
>
> On Thu, May 21, 2009 at 11:48 PM, Juan G. Arias <ju...@gmail.com>
> wrote:
> > Hi all,
> > I want to mantain an IRequestTarget in my component, as an instance
> > attribute. But wicket cries about it's not serializable.
> > Of course, it's right. IRequestTarget is not serializable.
> >
> > Why? Is something wrong with mantain a request target inside my
> component?
> >
> > Thanks!
> > Juan
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: IRequestTarget not serializable
Posted by Matej Knopp <ma...@gmail.com>.
IRequestTarget is valid only for one request. Why do you want to keep
as instance variable?
-Matej
On Thu, May 21, 2009 at 11:48 PM, Juan G. Arias <ju...@gmail.com> wrote:
> Hi all,
> I want to mantain an IRequestTarget in my component, as an instance
> attribute. But wicket cries about it's not serializable.
> Of course, it's right. IRequestTarget is not serializable.
>
> Why? Is something wrong with mantain a request target inside my component?
>
> Thanks!
> Juan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org