Skip to content

Commit

Permalink
Adding Messages as request attribute to enforce flash scope when redi…
Browse files Browse the repository at this point in the history
…rect
  • Loading branch information
garcia-jj committed Sep 16, 2014
1 parent f6d9de5 commit 780bb91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public <T extends View> T onErrorUse(Class<T> view) {
}

result.include("errors", getErrors());
result.include(Messages.ATTRIBUTE_KEY, messages);
outjector.outjectRequestMap();

logger.debug("there are errors on result: {}", getErrors());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Map;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

import org.slf4j.Logger;

Expand All @@ -40,10 +39,11 @@
* @since 4.1
* @author Otávio S Garcia
*/
@Named("vmessages")
@RequestScoped
public class Messages {

public static final String ATTRIBUTE_KEY = "vmessages";

private final static Logger log = getLogger(Messages.class);

private Map<Severity, List<Message>> messages = new HashMap<>();
Expand Down

0 comments on commit 780bb91

Please sign in to comment.