11-09-2021 01:02 PM
I have a module that is supposed to display a custom freemarker template. For testing purposes, the method is just this simple:
public String start() { return "asdf"; }
And I am getting this error:
javax.servlet.ServletException: Could not resolve view with name 'asdf' in servlet with name 'alfresco-mvc.mvc'
My webscripts are in: alfresco->extension->templates->webscripts->alfresco-mvc and so is my asdf.ftl
Where should I put my templates?
Or even better, how do I get a handle to the view resolver and set the path myself?
11-16-2021 12:05 PM
it is the first time you paste that error.
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
Make some effort and I am sure you will find the best combination that works for you.
11-18-2021 02:49 PM
So I could not exclude Alfresco's freemarker custom jar. So I can't upgrade my code. Since my front end is not complicated at all, it realy just formats some JSON that I get from my controllers (Using your mvc code) I simply switched to Velocity.
I tried to get a Velocity view resolver working, but I could not get that to work. Because of time constraints, (this project is for work) and I was pushing a deadline... I made a superclass for all my controllers that basically had one method, renderTemplate() I simply used the singleton setup for the velocity engine, rendered the template and sent back the html.
It may not be perfect, but it is working.
Explore our Alfresco products with the links below. Use labels to filter content by product module.