Do you see resolvers bypassing the grail?

I am trying to create a portlet inside a grails application and I have created a simple extender controller AbstractControllerthat returns

new ModelAndView('myportlet')from handleRequestInternal. I also have a standard installation Jstl view resolverfor /WEB-INF/jsp, but no matter what I try, when I try to view the portlet in liferay, I get the following stack:

13:19:39,723 ERROR [DispatcherPortlet:559] Could not complete request
java.lang.ClassCastException: org.springframework.web.portlet.context.PortletRequestAttributes cannot be cast to org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
    at org.codehaus.groovy.grails.web.util.WebUtils.retrieveGrailsWebRequest(WebUtils.java:497)
    at org.codehaus.groovy.grails.web.servlet.view.GrailsViewResolver.loadView(GrailsViewResolver.java:87)
    at org.codehaus.groovy.grails.scaffolding.view.ScaffoldingViewResolver.loadView(ScaffoldingViewResolver.java:61)
    at org.springframework.web.servlet.view.AbstractCachingViewResolver.createView(AbstractCachingViewResolver.java:158)
    at org.springframework.web.servlet.view.UrlBasedViewResolver.createView(UrlBasedViewResolver.java:384)
    at org.springframework.web.servlet.view.AbstractCachingViewResolver.resolveViewName(AbstractCachingViewResolver.java:77)
    at org.springframework.web.portlet.DispatcherPortlet.resolveViewName(DispatcherPortlet.java:1110)

It seems that if I could get around GrailsViewResolver, I would have to start and run my portlet in a regular spring application.

I use liferay 6, so the grails liferay plugin is not an option. Is there anything I can do to make sure that the GrailsViewResolver is not trying to allow my view in /WEB-INF/jsp?

+2
1

Grails, 100% . .

0

Source: https://habr.com/ru/post/1527601/


All Articles