Getting tml page output without HTML tags

I am using Tapestry5.3. I have a dynamic web project (prject name: test) with test.tml and


<!DOCTYPE html>
<html xmlns:t=""


public String getGenerateJson() {
return "welcome";

I have one more dynamic web project (project name: test2) with test2.tml and Both projects are running into my tomcat server.

From, I make a http connetion to for getting olny return value (welcome) in

final GetData data = new HttpGetData();
final String str = data.getContent("");
System.out.println("String: " + str); 



<!DOCTYPE html><html xmlns=""><head><link type="text/css" rel="stylesheet" href="/test/assets/1b4371c8cdb7af3/core/default.css"/><link type="text/css" rel="stylesheet" href="/test/assets/1b4371c8cdb7af3/jquery/themes/ui-lightness/jquery-ui-1.8.15.custom.css"/><meta content="Apache Tapestry Framework (version 5.3.1)" name="generator"/></head><body>

But I got output like that.

Is chance to get only welcome from Please give me your valuable suggestion or idea to achieve like that.


The simplest solution is to return a StreamResponse from your page's onActivate event. You won't need a template (.tml) to do this.

Object onActivate(EventContext context) {
   return new TextStreamResponse("text/plain", "welcome");

Since plain text isn't a great solution, you'll probably want to use JSON instead.

Object onActivate(EventContext context) {
   JSONObject json = new JSONObject("greeting", "welcome");
   return new TextStreamResponse("application/json", json.toCompactString());

For a simple way of creating restful webservices in tapestry, you might want to consider tapestry-resteasy

Need Your Help

How can I speed up hybrid property queries in SQLAlchemy?

python sql postgresql sqlalchemy

Is there a good way to speed up querying hybrid properties in SQLALchemy that involve relationships? I have the following two tables:

C++ - Using a copy constructor when returning an object-pointers?

c++ pointers constructor

There are three reasons why you should use a copy constructor when your class has a pointer. One of those is when a function returns a value of the class type. I was wondering what that meant? My g...