You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2014/10/05 02:55:15 UTC

5.4 PageActivationLink bug

Hi guys, I think I found a bug in 5.4.

I have the following page, Vehicle.class and within it a Request Parameter
called "key"

public class Vehicle.class  {

@ActivationRequestParameter(value = "_key")
    private String activationKey;

}

I also have an email service which is called by a method within
Vehicle.class that generates a confirmation email to the user. It looks
like this.

public void sendPurchaseReceiptEmail(VehicleListing vehicleListing) {
        Link link =
linkSource.createPageRenderLinkWithContext(ForSaleIndex.class,
Util.getGenerateListingContextID(vehicleListing));
System.out.println("sendPurchaseReceiptEmail " + emailMessage);
}

What I'm finding is when I generate a confirmation email with a link back
to the same page that has a request parameter in the URL, it is
automatically adding that request parameter to my link even though it's not
being added to the link with .addParameter()

Is this proper behavior? Should I be forced to remove the parameter
manually even though I'm generating a new link?

-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: 5.4 PageActivationLink bug

Posted by George Christman <gc...@cardaddy.com>.
I'm sorry, I probably should have posted more code. I'm using

@Inject
private PageRenderLinkSource linksouce;

On Wed, Oct 8, 2014 at 1:03 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Wed, 08 Oct 2014 13:38:24 -0300, Lance Java <la...@googlemail.com>
> wrote:
>
>  Also, LinkSource is in an "internal" package so isn't part of the public
>> API.
>>
>
> Yep. The public API one is PageRenderLinkSource.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: 5.4 PageActivationLink bug

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 08 Oct 2014 13:38:24 -0300, Lance Java <la...@googlemail.com>  
wrote:

> Also, LinkSource is in an "internal" package so isn't part of the public
> API.

Yep. The public API one is PageRenderLinkSource.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: 5.4 PageActivationLink bug

Posted by Lance Java <la...@googlemail.com>.
Also, LinkSource is in an "internal" package so isn't part of the public
API.

Re: 5.4 PageActivationLink bug

Posted by George Christman <gc...@cardaddy.com>.
Okay great, thanks Lance.

On Wed, Oct 8, 2014 at 10:37 AM, Lance Java <la...@googlemail.com>
wrote:

> It seems that LinkSource invokes onPassivate() which (I assume) is where
> the request parameter comes from
>
> from the javadocs:
>
> Creates a render link for the page. If an activation context is supplied
> then that context is built into the URI. If no activation context is
> supplied, then the activation context is obtained from the page itself, by
> triggering a passivate event on its root component.
> When the activationContext is an empty array, the targeted page is checked
> to see if it can provide an activation context. This is accomplished by
> triggering a "passivate" event on the targeted page. If the override
> parameter is true, this will not occur (even when the activation context is
> empty).
>
> I think you might want to call this instead:
> ComponentEventLinkEncoder.createPageRenderLink(PageRenderRequestParameters)
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: 5.4 PageActivationLink bug

Posted by Lance Java <la...@googlemail.com>.
It seems that LinkSource invokes onPassivate() which (I assume) is where
the request parameter comes from

from the javadocs:

Creates a render link for the page. If an activation context is supplied
then that context is built into the URI. If no activation context is
supplied, then the activation context is obtained from the page itself, by
triggering a passivate event on its root component.
When the activationContext is an empty array, the targeted page is checked
to see if it can provide an activation context. This is accomplished by
triggering a "passivate" event on the targeted page. If the override
parameter is true, this will not occur (even when the activation context is
empty).

I think you might want to call this instead:
ComponentEventLinkEncoder.createPageRenderLink(PageRenderRequestParameters)

Re: 5.4 PageActivationLink bug

Posted by George Christman <gc...@cardaddy.com>.
I'm not sure, I haven't had a case where I've been able to test that.

On Tue, Oct 7, 2014 at 4:58 PM, Lance Java <la...@googlemail.com>
wrote:

> Sounds like a bug to me. Does the same happen for a <t:pagelink />?
>  On 7 Oct 2014 17:44, "George Christman" <gc...@cardaddy.com> wrote:
>
> > Does anybody know if this is a bug or proper behavior?
> >
> > On Sat, Oct 4, 2014 at 8:55 PM, George Christman <
> gchristman@cardaddy.com>
> > wrote:
> >
> > > Hi guys, I think I found a bug in 5.4.
> > >
> > > I have the following page, Vehicle.class and within it a Request
> > Parameter
> > > called "key"
> > >
> > > public class Vehicle.class  {
> > >
> > > @ActivationRequestParameter(value = "_key")
> > >     private String activationKey;
> > >
> > > }
> > >
> > > I also have an email service which is called by a method within
> > > Vehicle.class that generates a confirmation email to the user. It looks
> > > like this.
> > >
> > > public void sendPurchaseReceiptEmail(VehicleListing vehicleListing) {
> > >         Link link =
> > > linkSource.createPageRenderLinkWithContext(ForSaleIndex.class,
> > > Util.getGenerateListingContextID(vehicleListing));
> > > System.out.println("sendPurchaseReceiptEmail " + emailMessage);
> > > }
> > >
> > > What I'm finding is when I generate a confirmation email with a link
> back
> > > to the same page that has a request parameter in the URL, it is
> > > automatically adding that request parameter to my link even though it's
> > not
> > > being added to the link with .addParameter()
> > >
> > > Is this proper behavior? Should I be forced to remove the parameter
> > > manually even though I'm generating a new link?
> > >
> > > --
> > > George Christman
> > > www.CarDaddy.com
> > > P.O. Box 735
> > > Johnstown, New York
> > >
> > >
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: 5.4 PageActivationLink bug

Posted by Lance Java <la...@googlemail.com>.
Sounds like a bug to me. Does the same happen for a <t:pagelink />?
 On 7 Oct 2014 17:44, "George Christman" <gc...@cardaddy.com> wrote:

> Does anybody know if this is a bug or proper behavior?
>
> On Sat, Oct 4, 2014 at 8:55 PM, George Christman <gc...@cardaddy.com>
> wrote:
>
> > Hi guys, I think I found a bug in 5.4.
> >
> > I have the following page, Vehicle.class and within it a Request
> Parameter
> > called "key"
> >
> > public class Vehicle.class  {
> >
> > @ActivationRequestParameter(value = "_key")
> >     private String activationKey;
> >
> > }
> >
> > I also have an email service which is called by a method within
> > Vehicle.class that generates a confirmation email to the user. It looks
> > like this.
> >
> > public void sendPurchaseReceiptEmail(VehicleListing vehicleListing) {
> >         Link link =
> > linkSource.createPageRenderLinkWithContext(ForSaleIndex.class,
> > Util.getGenerateListingContextID(vehicleListing));
> > System.out.println("sendPurchaseReceiptEmail " + emailMessage);
> > }
> >
> > What I'm finding is when I generate a confirmation email with a link back
> > to the same page that has a request parameter in the URL, it is
> > automatically adding that request parameter to my link even though it's
> not
> > being added to the link with .addParameter()
> >
> > Is this proper behavior? Should I be forced to remove the parameter
> > manually even though I'm generating a new link?
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
> >
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>

Re: 5.4 PageActivationLink bug

Posted by George Christman <gc...@cardaddy.com>.
Does anybody know if this is a bug or proper behavior?

On Sat, Oct 4, 2014 at 8:55 PM, George Christman <gc...@cardaddy.com>
wrote:

> Hi guys, I think I found a bug in 5.4.
>
> I have the following page, Vehicle.class and within it a Request Parameter
> called "key"
>
> public class Vehicle.class  {
>
> @ActivationRequestParameter(value = "_key")
>     private String activationKey;
>
> }
>
> I also have an email service which is called by a method within
> Vehicle.class that generates a confirmation email to the user. It looks
> like this.
>
> public void sendPurchaseReceiptEmail(VehicleListing vehicleListing) {
>         Link link =
> linkSource.createPageRenderLinkWithContext(ForSaleIndex.class,
> Util.getGenerateListingContextID(vehicleListing));
> System.out.println("sendPurchaseReceiptEmail " + emailMessage);
> }
>
> What I'm finding is when I generate a confirmation email with a link back
> to the same page that has a request parameter in the URL, it is
> automatically adding that request parameter to my link even though it's not
> being added to the link with .addParameter()
>
> Is this proper behavior? Should I be forced to remove the parameter
> manually even though I'm generating a new link?
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York