Re: Publisher - Subscriber pattern for Tapestry Service

2017-06-21 Thread Thiago H. de Paula Figueiredo
On Wed, Jun 21, 2017 at 1:42 AM, abangkis  wrote:

> I was thinking because of how the Services implementation & instantiation
> is managed by tapestry. How the service is injected instead of manually
> created.
>
> Thanks for the hint, I will look at those files source code.
>

There's absolutely nothing special in these classes' sources. They just
receive the observers as their distributed configuration and keep them in a
List or Collection field. But even if you wanted to add or remove observers
on the fly (i.e. after the Registry is started and all services
initialized) that wouldn't be a problem at all.

-- 
Thiago


Re: Slashes in query/context parameter

2017-06-21 Thread Nathan Quirynen

Hi Cezary,

Thanks, exactly what I needed.

As I am creating the link with the url parameter in another Tapestry 
application I can just use the URLEncoder.encode() method.



Op 20/06/2017 om 21:57 schreef Cezary Biernacki:

Tapestry uses its own encoding (with $ used as escape + four hex digits
unicode) for URLs, see org.apache.tapestry5.services.URLEncoder and
  implementation org.apache.tapestry5.internal.services.URLEncoderImpl

.

Try https://abc.com/?redirectUrl=https:$002f$002fdef.com$002fabc123$002f456



You can test encodings with this code:

TestPage.java

public class TestPage {

 @ActivationRequestParameter
 @Property
 private String redirectUrl;

 public void onActivate() {
 if (redirectUrl == null) {
 redirectUrl = "http://example.org/page;;
 }
 }
}


TestPage.tml
http://tapestry.apache.org/schema/tapestry_5_4.xsd;>


 
 
 
 






On Tue, Jun 20, 2017 at 6:12 PM, Nathan Quirynen <
nat...@pensionarchitects.be> wrote:


Hi,

I have a page that needs to accept an url as query or context parameter.

So for example: https://abc.com?redirectUrl=https://def.com/abc123/456

But Tapestry does not accept the slashes (even if I use the %2F notation):

*Input string '[...]' is not valid; the character '/' at position 7 is not
valid.*

How can I achieve what I need with Tapestry?


Nathan





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



Re: Slashes in query/context parameter

2017-06-21 Thread Nathan Quirynen

Hey,

I was using @ActivationRequestParameter as I need it to be a part of 
activation/passivation so it does not get lost when changing language 
for example.


Using Request.getParameter() does work, but then I'm not sure how to use 
activation/passivation exactly.


But as Cezary said in another reply, I can use URLEncoder in my other 
application (which is also a Tapestry application) to create the link 
with the url parameter and then use @ActivationRequestParameter.



Op 20/06/2017 om 23:17 schreef Thiago H. de Paula Figueiredo:

On Tue, Jun 20, 2017 at 1:12 PM, Nathan Quirynen <
nat...@pensionarchitects.be> wrote:


Hi,

I have a page that needs to accept an url as query or context parameter.

So for example: https://abc.com?redirectUrl=https://def.com/abc123/456

But Tapestry does not accept the slashes (even if I use the %2F notation):

*Input string '[...]' is not valid; the character '/' at position 7 is not
valid.*


How are you getting this query parameter value? I believe
Request.getParameter() should give you the right value without issues.



How can I achieve what I need with Tapestry?


Nathan







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