Tapestry5 page for rendering text

I searched but cannot find the documentation:

Is there a way for the page to display the response without wrapping the HTML elements and just print everything that is contained in the body of the theme or, in any case, regardless of what is set in MarkupWriter.write during @BeginRender?

I need a page that processes some server parts and returns pure javascript to request an external application.

If this is not possible, is it possible to set the Ioc tapestry on the servlet in one application?

Thank you, s.

+3
source share
2 answers

Sorry ponzao, but I found the best solution kindly provided by Thiago on the tapestry mailing list:

public class MyPage
{
    StreamResponse onActivate()
    {
        return new TextStreamResponse("text/plain", "some text");
    }
}

API tml.

, : http://wiki.apache.org/tapestry/Tapestry5HowToCreateADynamicPDF

+5

MarkupWriter.writeRaw MarkupWriter.write @BeginRender. - API.

. , - , , .

@Inject
private Response response

void onActivate() throws IOException {
    PrintWriter writer = response.getPrintWriter("text/html");
    writer.append("foobar");
    writer.close();
}
+2

Source: https://habr.com/ru/post/1747115/


All Articles