Examples of FlashScope


Examples of net.sourceforge.stripes.controller.FlashScope

     *
     * @return a List of Message objects associated with the current request, never null.
     */
    @SuppressWarnings("unchecked")
  public List<Message> getMessages(String key) {
        FlashScope scope = FlashScope.getCurrent(getRequest(), true);
        List<Message> messages = (List<Message>) scope.get(key);

        if (messages == null) {
            messages = new ArrayList<Message>();

            /*
             * Messages imported from previous flash scope will be present in request scope but not
             * in current flash scope. Handle such cases by copying the existing messages to a new
             * list in the current flash and request scopes.
             */
            if (getRequest().getAttribute(key) instanceof List) {
                try {
                    for (Message message : ((List<Message>) getRequest().getAttribute(key))) {
                        messages.add(message);
                    }
                }
                catch (ClassCastException e) {
                    messages.clear();
                }
            }

            scope.put(key, messages);
        }

        return messages;
    }
View Full Code Here

Examples of net.sourceforge.stripes.controller.FlashScope

            addParameters(request.getParameterMap());
        }

        // Add any beans to the flash scope
        if (this.beans != null) {
            FlashScope flash = FlashScope.getCurrent(request, true);
            for (ActionBean bean : this.beans) {
                flash.put(bean);
            }
        }

        // If a flash scope exists, add the parameter to the request
        FlashScope flash = FlashScope.getCurrent(request, false);
        if (flash != null) {
            addParameter(StripesConstants.URL_KEY_FLASH_SCOPE_ID, flash.key());
        }

        // Prepend the context path if requested
        String url = getUrl(request.getLocale());
        if (prependContext) {
View Full Code Here

Examples of org.springframework.webflow.scope.FlashScope

      flowContext = new GenericApplicationContext();
    }
    flowContext.setDisplayName("Flow ApplicationContext [" + getContext().getFlowId() + "]");
    flowContext.setParent(parent);
    flowContext.getBeanFactory().registerScope("request", new RequestScope());
    flowContext.getBeanFactory().registerScope("flash", new FlashScope());
    flowContext.getBeanFactory().registerScope("view", new ViewScope());
    flowContext.getBeanFactory().registerScope("flow", new FlowScope());
    flowContext.getBeanFactory().registerScope("conversation", new ConversationScope());
    Resource flowResource = flowModelHolder.getFlowModelResource();
    flowContext.setResourceLoader(new FlowRelativeResourceLoader(flowResource));
View Full Code Here

Examples of org.springframework.webflow.scope.FlashScope

      flowContext = new GenericApplicationContext();
    }
    flowContext.setDisplayName("Flow ApplicationContext [" + getContext().getFlowId() + "]");
    flowContext.setParent(parent);
    flowContext.getBeanFactory().registerScope("request", new RequestScope());
    flowContext.getBeanFactory().registerScope("flash", new FlashScope());
    flowContext.getBeanFactory().registerScope("view", new ViewScope());
    flowContext.getBeanFactory().registerScope("flow", new FlowScope());
    flowContext.getBeanFactory().registerScope("conversation", new ConversationScope());
    Resource flowResource = flowModelHolder.getFlowModelResource();
    flowContext.setResourceLoader(new FlowRelativeResourceLoader(flowResource));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.