<?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 Re: Spring MVC Controllers vs. Webscripts in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280308#M233438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Imagine you have a MVC controller that does two calls to the repository.&amp;nbsp;&amp;nbsp; Without re-inventing a little of the framework code there's the possibility call1 will succeed and call2 fails.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; That may or may not be a problem but at some point will hurt.&amp;nbsp;&amp;nbsp; So you need to make sure your Spring MNC controller is using the RetryingTransactionHelper correctly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also have alfresco webscripts with Java implementations if the use of alfresco script is a concern.&amp;nbsp; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Mar 2014 09:52:03 GMT</pubDate>
    <dc:creator>mrogers</dc:creator>
    <dc:date>2014-03-31T09:52:03Z</dc:date>
    <item>
      <title>Spring MVC Controllers vs. Webscripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280304#M233434</link>
      <description>I recently was able to add spring controllers to my Alfresco.&amp;nbsp; I just added this to my web.xml:&amp;nbsp;&amp;nbsp; &amp;lt;servlet&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;servlet-name&amp;gt;springMVC&amp;lt;/servlet-name&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;servlet-class&amp;gt;org.springframework.web.servlet.DispatcherServlet&amp;lt;/servlet-class&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;load-on-startup&amp;amp;g</description>
      <pubDate>Sun, 30 Mar 2014 05:47:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280304#M233434</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2014-03-30T05:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Spring MVC Controllers vs. Webscripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280305#M233435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There's nothing inherently wrong.&amp;nbsp;&amp;nbsp; However you are essentially re-inventing the wheel.&amp;nbsp; I'm surprised you think it's so much easier, web scripts are supposed to be simple and easy too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will need to handle your transactions and exceptions correctly ( with a retrying transaction helper ) so you will also need to reinvent some framework code to go on top of sping mvc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2014 15:56:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280305#M233435</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2014-03-30T15:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Spring MVC Controllers vs. Webscripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280306#M233436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I think web scripts are easy, but I am working with some VERY jr programmers whose only Java exposure is SpringMVC. So I thought it would be easier for them. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So if I inject, say, the node service into my web script, how is that different, transaction wise, from using it in a SpringMVC controller?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2014 17:01:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280306#M233436</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2014-03-30T17:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Spring MVC Controllers vs. Webscripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280307#M233437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been a Java developer for many years and love Spring and its MVC implementation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Having said that, I experimented webscripts with Alfresco and one of the main advantages I found was that I was able to modify my webscripts and test them simply refreshing the index page. This doesn't mean that I quit using Java and Spring, but this brought to me another point of view about developing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And remember that Alfresco always runs Spring under the hood, giving you all its power.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Well your developers should get acquainted with Javascript and Freemarker templates, but might save a lot of time recompiling and redeploying the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrea&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 06:54:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280307#M233437</guid>
      <dc:creator>abarisone</dc:creator>
      <dc:date>2014-03-31T06:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Spring MVC Controllers vs. Webscripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280308#M233438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Imagine you have a MVC controller that does two calls to the repository.&amp;nbsp;&amp;nbsp; Without re-inventing a little of the framework code there's the possibility call1 will succeed and call2 fails.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; That may or may not be a problem but at some point will hurt.&amp;nbsp;&amp;nbsp; So you need to make sure your Spring MNC controller is using the RetryingTransactionHelper correctly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also have alfresco webscripts with Java implementations if the use of alfresco script is a concern.&amp;nbsp; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 09:52:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280308#M233438</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2014-03-31T09:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Spring MVC Controllers vs. Webscripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280309#M233439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am aware the thread is old, but wanted to let you know about&amp;nbsp;&lt;A class="link-titled" href="https://github.com/dgradecak/alfresco-mvc" title="https://github.com/dgradecak/alfresco-mvc" rel="nofollow noopener noreferrer"&gt;GitHub - dgradecak/alfresco-mvc&lt;/A&gt;&amp;nbsp;that is a project I developed and actually is the glue code between alfresco and spring MVC. I am also using it on the share side and expose spring-data-rest for instance. On the repository side I wrote another module that uses alfresco @mvc to expose something that I call spring-data-alfresco and is actually exposing spring data repositories to be used within alfresco with actually an implementation that access alfresco as a spring data repository resource.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I highly recommend to check the original production ready and used in many projects (not by me only) Alfresco @MVC project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The wrong approach with what you have in the original post is that you do not use the webscript framwork, so no authentication etc are taken in consideration by alfresco., The module I am talking about is actually a webscript that uses a DispatcherServlet under the hood and therfore all the alfresco advices etc are being applied to every request to a spring controllers. And the lasts thing it has a pretty useful annotation to annotate services @AlfrescoTransaction (and some more).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you are not alone in this quest &lt;IMG src="https://connect.hyland.com/legacyfs/online/alfresco/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 08:11:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-mvc-controllers-vs-webscripts/m-p/280309#M233439</guid>
      <dc:creator>daniel_gradecak</dc:creator>
      <dc:date>2016-09-21T08:11:24Z</dc:date>
    </item>
  </channel>
</rss>

