Bug 183099 White spaces before parameter value are ignored in birt:paramDef tag.[]0603
Description: White spaces before parameter value are ignored in birt:paramDef tag. Build number:2.2.0.v200704190630 Steps to reproduce: 1. New a report with a string parameter and drag it to Layout. 2. New a jsp file with content: <birt:parameterPage id="0" name="customparameterpage" reportDesign="report.rptdesign" isCustom="true"> <birt:paramDef id="1" name="p_str" value=" value"/> <input type="submit" name="OK" value="submit"/> </birt:parameterPage> 3. Preview the jsp file. Expected result: Display " value" in web page. Actual result: Display "value" and three white spaces are lost. Error log:N/A
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/ParameterValidationUtil.java
import org.eclipse.birt.core.data.DataTypeUtil;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.core.format.DateFormatter;
import org.eclipse.birt.core.format.NumberFormatter;
import org.eclipse.birt.core.format.StringFormatter;
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
import org.eclipse.birt.report.model.api.metadata.PropertyValueException;
import org.eclipse.birt.report.model.api.metadata.ValidationValueException;
import org.eclipse.birt.report.model.i18n.ModelMessages;
import org.eclipse.birt.report.model.i18n.ThreadResources;
import org.eclipse.birt.report.model.metadata.BooleanPropertyType;
import com.ibm.icu.util.ULocale;
/**
 * Validates the parameter value with the given data type and format pattern
 * string. This util class can validate the parameter of the following types:
 * 
 * <ul>
 * <li><code>PARAM_TYPE_DATETIME</code></li>
 * <li><code>PARAM_TYPE_FLOAT</code></li>
 * <li><code>PARAM_TYPE_DECIMAL</code></li>
 * <li><code>PARAM_TYPE_BOOLEAN</code></li>
 * <li><code>PARAM_TYPE_STRING</code></li>
 * <li><code>PARAM_TYPE_INTEGER</code></li>
 * <li><code>PARAM_TYPE_DATE</code></li>
 * <li><code>PARAM_TYPE_TIME</code></li>
 * </ul>
 * 
 * @see org.eclipse.birt.report.model.api.elements.DesignChoiceConstants
 */
public class ParameterValidationUtil