Package net.sourceforge.stripes.controller

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>();
            scope.put(key, messages);
        }

        return messages;
    }
View Full Code Here


            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

          if (attachment != null) {
            if (attachment.getSize() > 0) {
              if (tckt==null) {
                tckt = bill.createTicket(getSession(), getAccount());
                setId(tckt.id());
                FlashScope oFscope = FlashScope.getCurrent(getContext().getRequest(), true);
                oFscope.put("ticket_docid", tckt.id());
              }
              TicketNote note = tckt.createNote(getSession(), attachment.getInputStream(), incCapturedCount(), attachment.getFileName());
              if (getCapturedPage1().length()==0) setCapturedPage1(note.id());
              attachment.delete();
            } else {
View Full Code Here

        Ticket tckt = bill.createTicket(getSession(), new AccountingAccount(getSession(), sAccount));
        disconnect();
        DepositToZespedBridge oDzb = new DepositToZespedBridge(CaptureService.BILLNOTES, lDepositId, Long.parseLong(tckt.getId()));
        oDzb.start();
        Log.out.debug("Done attaching sides");
        FlashScope oFscope = FlashScope.getCurrent(getContext().getRequest(), true);
        oFscope.put("ticket_docid", tckt.id());
      }     
      new CreditBurner(getSessionAttribute("user_uuid"),
               getSessionAttribute("customer_account_docid"),
               sService, sFlavor).start();
    } catch (Exception e) {
View Full Code Here

      sRetVal = sDefaultValue;
    return sRetVal;
  }
 
  public void setParam(String sParamName, String sParamValue) {
    FlashScope oFscope = FlashScope.getCurrent(getContext().getRequest(), true);
    oFscope.put(sParamName, sParamValue);   
  }
View Full Code Here

     *
     * @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

            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

TOP

Related Classes of net.sourceforge.stripes.controller.FlashScope

Copyright © 2018 www.massapicom. 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.