You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "IT.Adviser" <it...@gmail.com> on 2008/06/20 14:45:44 UTC

How to change url of active page to external link from Tapestry 5

I had submit event handler. I need to return external link (external to
site). Example: i work under site mysite.com, and need to change url (load
page into browser) from somethingelse.com.

As I understand I can use next code:

        @InjectPage
        private TestPage _test;

        public Object onSubmitFromTestForm() 
          {             
                return _test;
          }

I need Tapestry control TestPage, that opens link to somethingelse.com. I
don't know how to open this link. So problem not solved.

I can use
        public String onSubmitFromTestForm()
          {             
                return "TestPage";
          }

But I can link only to internal pages.

Also, I can do like this (in Taestry 4):

        public Link onSubmitFromAddForm()
          {             
              String authSubLogin;
                authSubLogin =
AuthSubUtil.getRequestUrl("http://localhost:8080/AddNew",
                                         
"http://www.google.com/calendar/feeds/",
                                          true,
                                          true /*session*/);
                
                return new StaticLink(authSubLogin);
          }


but in Tapestry 5 there is no StaticLink class. And there is no methods for
take string and give Link object. 
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/class-use/Link.html

What another solutions I can use for go to another url from java code?
-- 
View this message in context: http://www.nabble.com/How-to-change-url-of-active-page-to-external-link-from-Tapestry-5-tp18028798p18028798.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: How to change url of active page to external link from Tapestry 5

Posted by "IT.Adviser" <it...@gmail.com>.
Thank you! It works. But URL need been located in try-catch block. 

	public Object onSubmitFromTestForm() 
	  { 		
	      String linkString;
	        linkString = "http://somethingelse.com";

	        URL link = null;
	        try {
	        	link = new URL(linkString);
	        } catch (IOException e) {
	        	
	        } finally {
	        	
	        }
	        
	        return link;
	  }


Thiago H. de Paula Figueiredo wrote:
> 
> Em Fri, 20 Jun 2008 09:45:44 -0300, IT.Adviser <it...@gmail.com>  
> escreveu:
> 
> Return an URL object:
> 
> public Object onSubmitFromTestForm() {
> 	return new URL("http://somethingelse.com");
> }
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-change-url-of-active-page-to-external-link-from-Tapestry-5-tp18028798p18029071.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: How to change url of active page to external link from Tapestry 5

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 20 Jun 2008 09:45:44 -0300, IT.Adviser <it...@gmail.com>  
escreveu:

> I had submit event handler. I need to return external link (external to
> site). Example: i work under site mysite.com, and need to change url  
> (load page into browser) from somethingelse.com.

Return an URL object:

public Object onSubmitFromTestForm() {
	return new URL("http://somethingelse.com");
}

Thiago

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