/sitebricks-acceptance-tests/src/main/java/com/google/sitebricks/example/PageChain.java
http://github.com/dhanji/sitebricks · Java · 26 lines · 13 code · 5 blank · 8 comment · 0 complexity · 919923124e3c1c6fa18e01edf62f39a8 MD5 · raw file
- package com.google.sitebricks.example;
- import com.google.sitebricks.At;
- import com.google.sitebricks.http.Post;
- /**
- * Demonstrates passing state between pages, without
- * leaking it to the client or using a persistent datastore.
- *
- * @author dhanji@google.com (Dhanji R. Prasanna)
- */
- @At("/pagechain")
- public class PageChain {
- private String userValue;
- @Post NextPage redirect() {
- // Redirect to nextpage and use this provided instance,
- // that way we pass the custom value thru.
- return new NextPage(userValue);
- }
- public void setUserValue(String userValue) {
- this.userValue = userValue;
- }
- }