Thiago H. de Paula Figueiredo schrieb:
Em Thu, 06 Aug 2009 07:35:17 -0300, Sebastian Hennebrueder <use...@laliluna.de> escreveu:

Hello,

Hi!

To redirect to an external URL, all you need to do is to return a java.net.URL instance from an event handler method.

Hello,

I found this solution as well but the code is really not nice. Same is true for an anonymous implementation of Link.

Object onActionFromUrlresponse() {
                try {
                        URL url = new URL("http", "www.laliluna.de", "");
                        return url;
                } catch (MalformedURLException e) {
                        throw new RuntimeException(e);
                }
        }

What about something like this?
@Inject
private PageRenderLinkSource pageRenderLinkSource;

Link link = pageRenderLinkSource.createUrl("http://www.laliluna.de";).addParam("foo","foovalue").addParam("bar","barValue").addAnchor("#bla").build();

If the community find this useful and tell me the place where to implement the LinkFactory (pageRenderLinkSource is just an idea), I could code this.

--
Best Regards / Viele Grüße

Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de



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

Reply via email to