<?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: Cannot resolve view in module servlet in ACS. in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131901#M35575</link>
    <description>&lt;P&gt;I understand it's not out of the box.&amp;nbsp; And I am not using Share at all.&amp;nbsp; It is still a Spring application, so in theory there must be a way to generate Freemarker (or any view resolver) and plug it in.&lt;/P&gt;&lt;P&gt;Has anyone been able to do this?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Nov 2021 21:57:45 GMT</pubDate>
    <dc:creator>mangar</dc:creator>
    <dc:date>2021-11-09T21:57:45Z</dc:date>
    <item>
      <title>Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131899#M35573</link>
      <description>&lt;P&gt;I have a module that is supposed to display a custom freemarker template.&amp;nbsp; For testing purposes,&amp;nbsp; the method is just this simple:&lt;/P&gt;&lt;PRE&gt;    public String start() {
        return "asdf";
    }&lt;/PRE&gt;&lt;P&gt;And I am getting this error:&lt;/P&gt;&lt;PRE&gt;javax.servlet.ServletException: Could not resolve view with name 'asdf' in servlet with name 'alfresco-mvc.mvc'&lt;/PRE&gt;&lt;P&gt;My webscripts are in:&amp;nbsp; alfresco-&amp;gt;extension-&amp;gt;templates-&amp;gt;webscripts-&amp;gt;alfresco-mvc&amp;nbsp; and so is my asdf.ftl&lt;/P&gt;&lt;P&gt;Where should I put my templates?&lt;/P&gt;&lt;P&gt;Or even better,&amp;nbsp; how do I get a handle to the view resolver and set the path myself?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 18:02:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131899#M35573</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-11-09T18:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131900#M35574</link>
      <description>&lt;P&gt;You can create Freemarker web pages (Surf Pages):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/latest/develop/share-ext-points/surf-pages/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/content-services/latest/develop/share-ext-points/surf-pages/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Or JavaScript pages (Aikau Pages):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/latest/develop/share-ext-points/aikau-pages/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/content-services/latest/develop/share-ext-points/aikau-pages/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Spring MVC is not supported out-of-the-box by Share application.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 19:56:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131900#M35574</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-11-09T19:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131901#M35575</link>
      <description>&lt;P&gt;I understand it's not out of the box.&amp;nbsp; And I am not using Share at all.&amp;nbsp; It is still a Spring application, so in theory there must be a way to generate Freemarker (or any view resolver) and plug it in.&lt;/P&gt;&lt;P&gt;Has anyone been able to do this?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 21:57:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131901#M35575</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-11-09T21:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131902#M35576</link>
      <description>&lt;P&gt;Not sure if &lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/37735"&gt;@daniel_gradecak&lt;/A&gt; may help with that.&lt;/P&gt;
&lt;P&gt;He was making some experiments with that in the past:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dgradecak/alfresco-mvc" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/dgradecak/alfresco-mvc&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 09:01:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131902#M35576</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-11-10T09:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131903#M35577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I see that you are using alfresco-mvc. This is just a spring-mvc wrapper and is fully integrated with ACS.&lt;/P&gt;&lt;P&gt;The aim is to use mainly json and you either need a&amp;nbsp;@RestController or a&amp;nbsp;@Controller and annotated methods with&amp;nbsp;@ResponseBody&lt;/P&gt;&lt;P&gt;But if you want to use spring views than you need to really define a Spring view but that has nothing to do with Alfresco freemarker templates and java/js controllers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to use an Alfresco webscript and its own freemarker view refer to the Alfresco docs&lt;/P&gt;&lt;P&gt;but if you want to understand alfresco-mvc and spring viewes than it is purely standard Spring&amp;nbsp;&lt;A href="https://www.baeldung.com/freemarker-in-spring-mvc-tutorial" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.baeldung.com/freemarker-in-spring-mvc-tutorial&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 14:28:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131903#M35577</guid>
      <dc:creator>daniel_gradecak</dc:creator>
      <dc:date>2021-11-10T14:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131904#M35578</link>
      <description>&lt;P&gt;&lt;A href="https://hub.alfresco.com/t5/user/viewprofilepage/user-id/37735" target="_blank" rel="nofollow noopener noreferrer"&gt;@daniel_gradecak&amp;nbsp;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Yes,&amp;nbsp; I am using your alfresco-mvc module.&amp;nbsp; (Which I must congradulate you,&amp;nbsp; I use it in every alfresco project I work on.&amp;nbsp; It's incredible and I thank you for making it)&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My controller is annotated with&amp;nbsp;@controller&amp;nbsp; and my method looks like this:&lt;/P&gt;&lt;PRE&gt;    @GetMapping("/testView")
    @ResponseBody
    public String getFreemarkerView() {
    	return "test.ftl";
    }&lt;/PRE&gt;&lt;P&gt;When I call this,&amp;nbsp; I get the actual string "test.ftl"&amp;nbsp; But when I comment out the&amp;nbsp;@ResponseBody,&amp;nbsp; I get,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Could not resolve view with name 'test.ftl' in servlet with name 'alfresco-mvc.mvc'&lt;/PRE&gt;&lt;P&gt;And I have a test.ftl in src/main/resources&lt;/P&gt;&lt;P&gt;Does it look somewhere else?&amp;nbsp; Is there a way to set the template path?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 16:33:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131904#M35578</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-11-10T16:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131905#M35579</link>
      <description>&lt;P&gt;I am glad the project helps you, it is unfortunate that alfresco does not make it stadnard&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;Regarding your views, I highly recommend that you make yourself familiar with spring mvc views. Each view resolver has a configuration and can be configured in many different ways.&lt;/P&gt;&lt;P&gt;@ResponseBody is an anotation to specify the response content type as json usually and when you remove it Spring would look for a view resolver to return a view. I would never use freemarker today, but really just configure a resolver view in the servlet context and your a set.&lt;/P&gt;&lt;P&gt;I sent you the link and now I am pointing you to what you need&amp;nbsp;&lt;A href="https://www.baeldung.com/freemarker-in-spring-mvc-tutorial#2-configure-viewresolver" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.baeldung.com/freemarker-in-spring-mvc-tutorial#2-configure-viewresolver&lt;/A&gt; but please make your self familiar with spring mvc if you want to use it. My project just enables spring mvc in ACS and I would expect you to know how to use spring mvc.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 18:39:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131905#M35579</guid>
      <dc:creator>daniel_gradecak</dc:creator>
      <dc:date>2021-11-10T18:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131906#M35580</link>
      <description>&lt;P&gt;I think I do know my MVC pretty well,&amp;nbsp; but the entire problem roots from not being able to create a freemarker config object like I normally do.&amp;nbsp; I havve used this succsessfully in plenty of Spring MVC applications:&lt;/P&gt;&lt;PRE&gt;	@Bean 
	public FreeMarkerViewResolver freemarkerViewResolver() { 
	    FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); 
	    resolver.setCache(true); 
	    resolver.setPrefix(""); 
	    resolver.setSuffix(".ftl"); 
	    return resolver; 
	}
	
	@Bean 
	public FreeMarkerConfigurer freemarkerConfig() { 
	    FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer(); 
	    freeMarkerConfigurer.setTemplateLoaderPath("/WEB-INF/views/ftl/");
	    return freeMarkerConfigurer; 
	}	&lt;/PRE&gt;&lt;P&gt;But now in alfresco,&amp;nbsp; I get:&lt;/P&gt;&lt;PRE&gt;org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'freemarkerConfig' defined in org.gnma.alfresco.web.config.DamsServletContext: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: 'void freemarker.template.Configuration.&amp;lt;init&amp;gt;(freemarker.template.Version)'&lt;/PRE&gt;&lt;P&gt;Which is why I was moving to some other template manager.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:57:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131906#M35580</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-11-16T16:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131907#M35581</link>
      <description>&lt;P&gt;it is the first time you paste that error.&lt;/P&gt;&lt;P&gt;Alfresco already includes a freemarker jar and it is a different version than you expect. So that is why you have to pay more attention to how you define and use things. This is not the latest spring boot version &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;Make some effort and I am sure you will find the best combination that works for you.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 17:05:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131907#M35581</guid>
      <dc:creator>daniel_gradecak</dc:creator>
      <dc:date>2021-11-16T17:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131908#M35582</link>
      <description>&lt;P&gt;FYI:&amp;nbsp;Configuration(Version)&lt;SPAN&gt;&amp;nbsp;was added in FreeMarker 2.3.21&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and alfresco uses in their latest version&amp;nbsp;freemarker-2.3.20-alfresco-patched-20200421.jar&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 17:50:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131908#M35582</guid>
      <dc:creator>daniel_gradecak</dc:creator>
      <dc:date>2021-11-16T17:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot resolve view in module servlet in ACS.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131909#M35583</link>
      <description>&lt;P&gt;So I could not exclude Alfresco's freemarker custom jar.&amp;nbsp; So I can't upgrade my code.&amp;nbsp; Since my front end is not complicated at all,&amp;nbsp; it realy just formats some JSON that I get from my controllers (Using your mvc code)&amp;nbsp; I simply switched to Velocity.&lt;/P&gt;&lt;P&gt;I tried to get a Velocity view resolver working,&amp;nbsp; but I could not get that to work. Because of time constraints,&amp;nbsp; (this project is for work)&amp;nbsp; and I was pushing a deadline...&amp;nbsp; I made a superclass for all my controllers that basically had one method,&amp;nbsp; renderTemplate()&amp;nbsp; I simply used the singleton setup for the velocity engine, rendered the template and sent back the html.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It may not be perfect,&amp;nbsp; but it is working.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 19:49:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cannot-resolve-view-in-module-servlet-in-acs/m-p/131909#M35583</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-11-18T19:49:58Z</dc:date>
    </item>
  </channel>
</rss>

