item.addDC(element, qualifier, lang, (String) vals.get(i));
String s = (String) vals.get(i); if (s != null && !s.trim().equals("")) { item.addDC(element, qualifier, lang, s); }
    private void readText(HttpServletRequest request,        Item item,        String element,        String qualifier,        boolean repeated,        String lang)    {        // FIXME: Of course, language should be part of form, or determined        // some other way        String dcname = element;        if (qualifier != null)        {            dcname = element + "_" + qualifier;        }        // Values to add        List vals = new LinkedList();        if (repeated)        {            vals = getRepeatedParameter(request, dcname);            // Find out if the relevant "remove" button was pressed            String buttonPressed = UIUtil.getSubmitButton(request, "");            String removeButton = "submit_" + dcname + "_remove_";            if (buttonPressed.startsWith(removeButton))            {                int valToRemove = Integer.parseInt(                    buttonPressed.substring(removeButton.length()));                vals.remove(valToRemove);            }        }        else        {            // Just a single name            String s = request.getParameter(dcname);            // Only put it in if there was a name present            if (s != null && !s.equals(""))            {                vals.add(s);            }        }        // Remove existing values        item.clearDC(element, qualifier, Item.ANY);        // Put the names in the correct form        for (int i = 0; i < vals.size(); i++)        {            // Add to the database            item.addDC(element, qualifier, lang, (String) vals.get(i));        }    }