br.com.caelum.vraptor:vraptor-streamable-pages

Compose your complex pages with small jsps instead of write a big one.

Группа

Группа

br.com.caelum.vraptor
Идентификатор

Идентификатор

vraptor-streamable-pages
Последняя версия

Последняя версия

4.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Compose your complex pages with small jsps instead of write a big one.
Система контроля версий

Система контроля версий

http://github.com/asouza/vraptor-streamable-pages

Скачать vraptor-streamable-pages

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/br.com.caelum.vraptor/vraptor-streamable-pages/ -->
<dependency>
    <groupId>br.com.caelum.vraptor</groupId>
    <artifactId>vraptor-streamable-pages</artifactId>
    <version>4.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/br.com.caelum.vraptor/vraptor-streamable-pages/
implementation 'br.com.caelum.vraptor:vraptor-streamable-pages:4.0.1'
// https://jarcasting.com/artifacts/br.com.caelum.vraptor/vraptor-streamable-pages/
implementation ("br.com.caelum.vraptor:vraptor-streamable-pages:4.0.1")
'br.com.caelum.vraptor:vraptor-streamable-pages:jar:4.0.1'
<dependency org="br.com.caelum.vraptor" name="vraptor-streamable-pages" rev="4.0.1">
  <artifact name="vraptor-streamable-pages" type="jar" />
</dependency>
@Grapes(
@Grab(group='br.com.caelum.vraptor', module='vraptor-streamable-pages', version='4.0.1')
)
libraryDependencies += "br.com.caelum.vraptor" % "vraptor-streamable-pages" % "4.0.1"
[br.com.caelum.vraptor/vraptor-streamable-pages "4.0.1"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
br.com.caelum : vraptor jar 4.0.0.Final
org.jboss.weld.servlet : weld-servlet-core jar 2.1.2.Final
org.jboss.weld : weld-core-impl jar 2.1.2.Final
com.ning : async-http-client jar 1.8.4
org.scala-lang : scala-library jar 2.10.4

provided (3)

Идентификатор библиотеки Тип Версия
javax.inject : javax.inject jar 1
javax.servlet : javax.servlet-api jar 3.1.0
javax.servlet : jsp-api jar 2.0

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.mockito : mockito-all jar 1.9.0
io.undertow : undertow-core jar 1.0.1.Final
io.undertow : undertow-servlet jar 1.0.1.Final

Модули Проекта

Данный проект не имеет модулей.

VRaptor streamable pages

This projects aims to enable async rendering of htmls using VRaptor. The inspiration came from this Linkedin talk(http://engineering.linkedin.com/play/composable-and-streamable-play-apps).

#Configuring

If you are using maven, simply add the following dependency:

<dependency>
    <groupId>br.com.caelum.vraptor</groupId>
    <artifactId>vraptor-streamable-pages</artifactId>
    <version>4.0.1</version>
</dependency>

#Example

Take a look on this example:

@Controller
public class IndexController {

	private final Result result;
	@Inject
	private Streamer streamer;

	/**
	 * @deprecated CDI eyes only
	 */
	public IndexController() {
		this(null);
	}

	@Inject
	public IndexController(Result result) {
		this.result = result;
	}

	@Path("/")
	public void index() throws IOException, InterruptedException, ExecutionException {
		streamer.order("http://localhost:8080/vraptor-blank-project/index/start")
				.unOrder("http://localhost:8080/vraptor-blank-project/header",
						"http://localhost:8080/vraptor-blank-project/body",
						"http://localhost:8080/vraptor-blank-project/footer")
				.order("http://localhost:8080/vraptor-blank-project/end");
		result.nothing();
	}

    @Path("/start")
	public void start() {
		result.include("variable", "VRaptor!");
	}

    @Path("/header")
	public void header() throws InterruptedException {
		Thread.sleep(2000);
	}

    @Path("/body")
	public void body() {
	}

    @Path("/footer")
	public void footer() {
	}

    @Path("/path")
	public void end() {

	}

}

Example using jsp

You can also use our taglib to achieve the same result. Suppose that your /WEB-INF/jsp/index/inidex.jsp is like this:

<%@taglib prefix="streamer" uri="http://vraptor.org/jsp/taglib/streamer" %>
<html>
    <head>
        <link src="css/styles.css" rel="stylesheet">
    </head>
    <body>
        <div id="header-pagelet"></div>
        <div id="body-pagelet"></div>
        <div id="footer-pagelet"></div>

        <streamer:stream>
            <streamer:page url="header"/>
            <streamer:page url="body"/>
            <streamer:page url="footer"/>
        </streamer:stream>
    </body>
</html>

Версии библиотеки

Версия
4.0.1
4.0.0