Sending custom html file when GET params set


I wish to send text or html page that has nothing to do with your ajax kit when user hits a button in toolkit app. No download, it should really move from toolkit app into my text/html page. Cant seem to find out way to do this, any ideas?

So, are we talking of hyperlink functionality here, have you tried Link component?

I do not want to use link! Text or html file is generated within java code, it is done inside toolkit. So if someone comes with certain parameter or uri inside my toolkit app it can response custom stream such as text or html… Suppose I could do another servlet for this but how could I do it from toolkit ?

See com.itmill.toolkit.terminal.URIHandler#handleURI(URL, String), within your application implement it. Under

public DownloadStream handleURI(URL context, String relativeUri) {
  // inspect relativeURI and based on that data..
  // add your code here..

  // return your stream..
  ByteArrayInputStream is = new ByteArrayInputStream(result.getBytes());
  DownloadStream ds = new DownloadStream(is, "text/html", "myfilename");
  return ds;

Try this one:

With this: