cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot resolve view in module servlet in ACS.

mangar
Star Contributor
Star Contributor

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?

1 ACCEPTED ANSWER

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 Smiley Wink

Make some effort and I am sure you will find the best combination that works for you.

View answer in original post

10 REPLIES 10

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.