Hi Chanika,

After escaping text from client side, I was able to get the issue resolved.

However is there any way where we can ask DSS to escape/parse those values
by modifying query or some mechanism.

On Thu, Mar 10, 2016 at 10:55 AM, Udara Liyanage <[email protected]> wrote:

> Hi Chanika,
>
> Now I escapded the value using StringEscapeUtils.escapeHtml.
> But still it throws a similar error.
>
> Escaped value:
> role=Lead - HR &amp; Administration
>
> On Thu, Mar 10, 2016 at 10:41 AM, Chanika Geeganage <[email protected]>
> wrote:
>
>> Hi Udara,
>>
>> White spaces are parsed without any issue. For the character & you can
>> pass it as '&amp;' or wrap it within CDATA.For an example,
>>
>> <![CDATA[Lead - HR & Administration]]>
>>
>> Thanks
>>
>>
>> On Thu, Mar 10, 2016 at 9:59 AM, Udara Liyanage <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I have below query in my DSS configs. However this fails when values
>>> have spaces or special characters &.
>>>   <query id="AddEmployeeTemp" useConfig="allocationDS">
>>>       <sql>INSERT  INTO
>>> employees(Employee_Id,First_Name,Last_Name,Work_Email,Gender,Job_Role,Department,Reports_To,Product,)
>>> VALUES ( :id,
>>> :firstName,:lastName,:email,:gender,:role,:department,:reportsTo,:product,:team);</sql>
>>>       <param name="id" sqlType="STRING"/>
>>>       <param name="firstName" sqlType="STRING"/>
>>>       <param name="lastName" sqlType="STRING"/>
>>>       <param name="email" sqlType="STRING"/>
>>>       <param name="role" sqlType="STRING"/>
>>>       <param name="gender" sqlType="STRING"/>
>>>       <param name="reportsTo" sqlType="STRING"/>
>>>       <param name="team" sqlType="STRING"/>
>>>       <param name="product" sqlType="STRING"/>
>>>       <param name="department" sqlType="STRING"/>
>>>    </query>
>>>
>>> Problematic values:
>>> department=HUMAN RESOURCES AND ADMINISTRATION, role=Lead - HR &
>>> Administration,
>>>
>>>
>>> I tried escaping with single quote (':department') and double
>>> quote(":department"), both did not work for me.  What modification should
>>> be done to add values with spaces and special characters.
>>>
>>> Udara Liyanage
>>> Software Engineer
>>> WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> web: http://udaraliyanage.wordpress.com
>>> phone: +94 71 443 6897
>>>
>>
>>
>>
>> --
>> Best Regards..
>>
>> Chanika Geeganage
>> Software Engineer
>> WSO2, Inc.; http://wso2.com
>>
>>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to