String newBagName = "new_bag";  if (savedBags == null) { savedBags = new LinkedHashMap(); session.setAttribute(Constants.SAVED_BAGS, savedBags); }
String newBagName = buildBagForm.getBagName(); Map savedBags = BagHelper.getSavedBags(session);
    public ActionForward makeStringBag(ActionMapping mapping,                                       ActionForm form,                                       HttpServletRequest request,                                       HttpServletResponse response)        throws Exception {        HttpSession session = request.getSession();        Map savedBags = (Map) session.getAttribute(Constants.SAVED_BAGS);        BuildBagForm buildBagForm = (BuildBagForm) form;        InterMineBag bag = new InterMineBag();        String trimmedText = buildBagForm.getText().trim();        if (trimmedText.length() == 0) {        } else {            for (StringTokenizer st = new StringTokenizer(trimmedText, " \t");                 st.hasMoreTokens();) {                String token = st.nextToken();                bag.add(token);            }        }        String newBagName = "new_bag";        if (savedBags == null) {            savedBags = new LinkedHashMap();            session.setAttribute(Constants.SAVED_BAGS, savedBags);        }        BagHelper.saveBag(bag, newBagName, savedBags);        String forwardPath = mapping.findForward("bagDetails").getPath() + "?bagName=" + newBagName;        ActionMessages actionMessages = new ActionMessages();        actionMessages.add(ActionMessages.GLOBAL_MESSAGE,                           new ActionError("bagBuilder.saved", newBagName));        saveMessages(request, actionMessages);        return new ActionForward(forwardPath);    }