You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Angelo C." <an...@gmail.com> on 2012/08/17 03:55:01 UTC

redirecting in the same page class

Hi,

I have a page class(mypage) with two methods:

#1. Object onActivate(String code) 

#2. Object onActivate(String code, String entry) 


so I can pass localhost:8080/mypage/0001/#entry, this matches method #1, I'd
like that method #2 will redirect it to method #1 using code and entry, so :

/mypage/0001/entry will redirect to
/mypage/0001/#entry

 possible?

Thanks,

Angelo



--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting in the same page class

Posted by "Angelo C." <an...@gmail.com>.
cool, most of time t5 already got something ahead of my poor imagination,
thanks.


Howard Lewis Ship wrote
> 
> The Link object already has a setAnchor() method.  It's called OO
> Design, people :-)
> 
> Also note that the server *never sees* the anchor; that stays on the
> client and is not part of the HTTP GET/POST request in any way. It is
> not accessible.
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@.apache
> For additional commands, e-mail: users-help@.apache
> 




--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715558.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting in the same page class

Posted by "Angelo C." <an...@gmail.com>.
https://issues.apache.org/jira/browse/TAP5-1990



--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715567.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting in the same page class

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 17 Aug 2012 22:29:24 -0300, Angelo C. <an...@gmail.com>  
wrote:

> could have been nice if setAnchor returns Link instead of void so we can
> have:
>
> return renderLinkSource.createPageRenderLinkWithContext(MyClass.class,
> code).setAnchor(entry)

Sounds like a good, harmless (aka backward-compatible) change. JIRA  
please? :)

-- 
Thiago H. de Paula Figueiredo

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


Re: redirecting in the same page class

Posted by "Angelo C." <an...@gmail.com>.
could have been nice if setAnchor returns Link instead of void so we can
have:

return renderLinkSource.createPageRenderLinkWithContext(MyClass.class,
code).setAnchor(entry)


Howard Lewis Ship wrote
> 
> The Link object already has a setAnchor() method.  It's called OO
> Design, people :-)
> 
> 
> 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715559.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting in the same page class

Posted by Howard Lewis Ship <hl...@gmail.com>.
The Link object already has a setAnchor() method.  It's called OO
Design, people :-)

Also note that the server *never sees* the anchor; that stays on the
client and is not part of the HTTP GET/POST request in any way. It is
not accessible.

On Fri, Aug 17, 2012 at 7:12 AM, Angelo C. <an...@gmail.com> wrote:
> right, might be nice if PageRenderLinkSource can add another two methods:
>
> createPageRenderLinkWithContextAndAnchor
> createPageRenderLinkWithAnchor
>
> the use case is, say you are converting your app into Backbonejs based, you
> might like to redirect:
>
> /mypage/0001 to
> /mypage#0001
>
> and you would like to keep the old link as well.
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715541.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: redirecting in the same page class

Posted by "Angelo C." <an...@gmail.com>.
right, might be nice if PageRenderLinkSource can add another two methods:

createPageRenderLinkWithContextAndAnchor
createPageRenderLinkWithAnchor

the use case is, say you are converting your app into Backbonejs based, you
might like to redirect:

/mypage/0001 to
/mypage#0001

and you would like to keep the old link as well.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715541.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting in the same page class

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 17 Aug 2012 07:43:27 -0300, Michael Gentry <mg...@masslight.net>  
wrote:

> Hi Angelo,
>
> Can't you just have #2 call #1?  Something like:
>
> Object onActivate((String code, String entry)
> {
>   this.entry = entry;
>   return onActivate(code);
> }

 From Angelo's code, it seemed he needed to add an anchor too, so just  
returning 'this' in onActivate() wouldn't suffice.

>
> mrg
>
> On Thu, Aug 16, 2012 at 10:29 PM, Angelo C. <an...@gmail.com>  
> wrote:
>> turned out, T5 already has this:
>>
>> Link lnk =  
>> renderLinkSource.createPageRenderLinkWithContext(Mypage.class,
>> code);
>> lnk.setAnchor(entry);
>> return lnk
>>
>>
>>
>> --
>> View this message in context:  
>> http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715529.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


-- 
Thiago H. de Paula Figueiredo

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


Re: redirecting in the same page class

Posted by Michael Gentry <mg...@masslight.net>.
Hi Angelo,

Can't you just have #2 call #1?  Something like:

Object onActivate((String code, String entry)
{
  this.entry = entry;
  return onActivate(code);
}

mrg

On Thu, Aug 16, 2012 at 10:29 PM, Angelo C. <an...@gmail.com> wrote:
> turned out, T5 already has this:
>
> Link lnk = renderLinkSource.createPageRenderLinkWithContext(Mypage.class,
> code);
> lnk.setAnchor(entry);
> return lnk
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715529.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: redirecting in the same page class

Posted by "Angelo C." <an...@gmail.com>.
turned out, T5 already has this:

Link lnk = renderLinkSource.createPageRenderLinkWithContext(Mypage.class,
code);
lnk.setAnchor(entry);
return lnk



--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-in-the-same-page-class-tp5715525p5715529.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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