OPIAM stands for Open Identity and Access Management. This Suite will provide modules for user & rig

源代码在线查看: formutils.java

软件大小: 5332 K
上传用户: ASD___1234
关键词: Management for Identity provide
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				 * OPIAM Suite
				 *
				 * Distributable under LGPL license.
				 * See terms of license at gnu.org.
				 */
				
				package opiam.admin.faare.struts.utils;
				
				import java.util.ArrayList;
				import java.util.StringTokenizer;
				
				/**
				 * This class contains utility methods for HTML forms processing.
				 */
				
				public final class FormUtils
				{
				    /** Utility class. */
				    private FormUtils()
				    {
				    }
				
				    /**
				     * This method must be called by an edition FormBean to get the values of
				     * a multivalued attribute filled by the MultiEdit tag.
				     *
				     * @param desc value gor from the form
				     * @return list of values of the attribute
				     */
				    public static ArrayList getMultiVal(String desc)
				    {
				        if (desc.trim().equals(""))
				        {
				            return null;
				        }
				
				        desc = desc.substring(1);
				
				        StringTokenizer tok = new StringTokenizer(desc, "#");
				        ArrayList vals = new ArrayList();
				
				        while (tok.hasMoreTokens())
				        {
				            String aval = tok.nextToken();
				
				            if (!aval.trim().equals(""))
				            {
				                vals.add(aval);
				            }
				        }
				
				        if (vals.size() == 0)
				        {
				            vals = null;
				        }
				
				        return vals;
				    }
				}
							

相关资源