<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Decode in Java webscript  in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/decode-in-java-webscript/m-p/46430#M18499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling a java webscript from a ftl.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;var uri = Alfresco.constants.PROXY_URI+"/vs/insurancetype?" + encodeURIComponent("company="+companyValue+"&amp;amp;insurancetype="+insuranceValue);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;this.register = function () {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Alfresco.util.Ajax.jsonGet({&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;url: uri,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;successCallback: {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fn: this.updateSubInsuranceType,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scope: this&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; failureCallback: {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fn: function(){},&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scope: this&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Passing Parameter:&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;var&amp;nbsp;&lt;EM&gt;companyValue = "A&amp;amp;B Company";&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&lt;EM&gt;var&amp;nbsp;&lt;EM&gt;insuranceValue = "R&amp;amp;K insurance"&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Request URL:&lt;/P&gt;&lt;OL class="" style="color: #303942; border-bottom: 1px solid #e0e0e0; font-size: 12px; padding-left: 10px; padding-bottom: 5px;"&gt;&lt;LI style="margin-left: 10px; margin-top: 1px; padding-left: 5px;"&gt;&lt;DIV class="" style="color: #545454; font-weight: bold; margin-right: 0.25em;"&gt;Request URL:&lt;/DIV&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;DIV class="" style="font-size: 11px !important; margin-top: 1px; margin-right: 1em;"&gt;&lt;A _jive_internal="true" href="https://community.alfresco.com/vs/insurance-sub-type?company%3DCompany%201%26insurancetype%3DD%26A%20aaa" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:8080/share/proxy/alfresco//vs/insurance-sub-type?company%3DCompany%201%26insurancetype%3DD%26A%20aaa&lt;/A&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I get the request in Java Webscript.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final String insuranceCompany = req.getParameter("company");&amp;nbsp; &amp;nbsp;///&lt;EM&gt;&lt;EM&gt;companyValue&lt;/EM&gt;&lt;/EM&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;EM&gt;&lt;EM&gt;A&lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;final String insurancetype = req.getParameter("insurancetype");&amp;nbsp; &amp;nbsp;///&amp;nbsp;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;insuranceValue=R&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;Basically, I am not getting right parameter from the request&amp;nbsp;object.&amp;nbsp;&lt;BR /&gt;Please suggest...&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2018 11:15:13 GMT</pubDate>
    <dc:creator>ratik_singhal</dc:creator>
    <dc:date>2018-08-06T11:15:13Z</dc:date>
    <item>
      <title>Decode in Java webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/decode-in-java-webscript/m-p/46430#M18499</link>
      <description>Hello All,I am calling a java webscript from a ftl.&amp;nbsp;var uri = Alfresco.constants.PROXY_URI+"/vs/insurancetype?" + encodeURIComponent("company="+companyValue+"&amp;amp;insurancetype="+insuranceValue);this.register = function () {Alfresco.util.Ajax.jsonGet({&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;url: uri,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;successCallback: {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;</description>
      <pubDate>Mon, 06 Aug 2018 11:15:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/decode-in-java-webscript/m-p/46430#M18499</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-08-06T11:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Decode in Java webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/decode-in-java-webscript/m-p/46431#M18500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should not be encoding the entire URL arguments via encodeURIComponent. It is more appropriate to encode only the values individually before combining them into the URL. So the URL should look more like&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.alfresco.com/vs/insurance-sub-type?company%3DCompany%201%26insurancetype%3DD%26A%20aaa" style="color: #1e88e5; background-color: #ffffff; border: 0px; text-decoration: none; font-size: 11px;" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/share/proxy/alfresco/vs/insurance-sub-type?company=Company%201&amp;amp;insurancetype=D%26A%20aaa&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(Note: You also do not need the leading slash in your URL addition since the PROXY_URI already ends with a slash)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 08:31:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/decode-in-java-webscript/m-p/46431#M18500</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-07T08:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Decode in Java webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/decode-in-java-webscript/m-p/46432#M18501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thanks for reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already tried this way too...Only encode value "A&amp;amp;B Company" but still in WebScriptRequest I am getting full path and parameters value without encoding. I have tried to decode as well in java webscript&amp;nbsp;as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 09:00:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/decode-in-java-webscript/m-p/46432#M18501</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-08-07T09:00:18Z</dc:date>
    </item>
  </channel>
</rss>

