<?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 Webscripts url mapping behaves differently when written in Java vs. Javascript in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/webscripts-url-mapping-behaves-differently-when-written-in-java/m-p/293410#M246540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just noticed some behavior regarding web scripts. Maybe somebody has an idea why this happens or whether it's a bug in Alfresco.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have two (GET) web scripts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;strong&amp;gt;Webscript A&amp;lt;/strong&amp;gt; has the following URL in it's descriptor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;url&amp;gt;/api/v1/folders/{path}&amp;lt;/url&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;strong&amp;gt;Webscript B&amp;lt;/strong&amp;gt; has the following URL in it's descriptor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;url&amp;gt;/api/v1/folders/{path}/files&amp;lt;/url&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that the urls only differ with the "/files" in the end.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The strange thing now is that when both web scripts are written in javascript (thus also not needed to be registered in any xml context file), it's not possible to reach webscript B, because A already caught the requests falsely (because of the overlapping URL pattern, I assume, but without checking for further patterns that match better).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, I call the URL like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;GET /api/v1/folders/myFolderX/files&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would expect that the request would go to webscript B (due to the "/files" at the end), but instead it goes to webscript A, which throws an error due to mismatching business logic in there of course.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But: if I rewrite the web scripts in Java (and no changes to the descriptor or url pattern), register them in my xml context file, then everything works as expected and my request actually reaches webscript B.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea why this is?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2015 12:24:53 GMT</pubDate>
    <dc:creator>mathias_lin</dc:creator>
    <dc:date>2015-07-28T12:24:53Z</dc:date>
    <item>
      <title>Webscripts url mapping behaves differently when written in Java vs. Javascript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/webscripts-url-mapping-behaves-differently-when-written-in-java/m-p/293410#M246540</link>
      <description>I just noticed some behavior regarding web scripts. Maybe somebody has an idea why this happens or whether it's a bug in Alfresco.I have two (GET) web scripts:&amp;lt;strong&amp;gt;Webscript A&amp;lt;/strong&amp;gt; has the following URL in it's descriptor:&amp;lt;url&amp;gt;/api/v1/folders/{path}&amp;lt;/url&amp;gt;‍&amp;lt;strong&amp;gt;</description>
      <pubDate>Tue, 28 Jul 2015 12:24:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/webscripts-url-mapping-behaves-differently-when-written-in-java/m-p/293410#M246540</guid>
      <dc:creator>mathias_lin</dc:creator>
      <dc:date>2015-07-28T12:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Webscripts url mapping behaves differently when written in Java vs. Javascript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/webscripts-url-mapping-behaves-differently-when-written-in-java/m-p/293411#M246541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems to be a bug. I created a bug report in Jira: &lt;/SPAN&gt;&lt;A href="https://issues.alfresco.com/jira/browse/ALF-21404" rel="nofollow noopener noreferrer"&gt;https://issues.alfresco.com/jira/browse/ALF-21404&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Aug 2015 17:43:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/webscripts-url-mapping-behaves-differently-when-written-in-java/m-p/293411#M246541</guid>
      <dc:creator>mathias_lin</dc:creator>
      <dc:date>2015-08-02T17:43:08Z</dc:date>
    </item>
  </channel>
</rss>

