Pergunta

We've been using Dynamic Reports directly in our Grails 1.3.7 app with great success. However, when we upgraded to Grails 2.2.4, the images are broken in the HTML view. The hyperlink generated leads to a 404, even for static content such as logos. All the other reports work fine. I am thinking the maybe the image factory servlet needs to be registered in web.xml or something like that. Does anyone have any pointers?

Foi útil?

Solução 2

Here is the solution. (Thanks to Ricardo over at DynamicReports help forum!)

The image servlet must indeed be registered in /src/templates/war/web.xml configuration. We did not have to do this in Grails 1.3.7. Hope this helps someone else!

<servlet>
    <servlet-name>ImageServlet</servlet-name>
    <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class>
</servlet>  

<servlet-mapping>   
    <servlet-name>ImageServlet</servlet-name>   
    <url-pattern>/image</url-pattern>   
</servlet-mapping>

Outras dicas

I recommend you to create a new application and to use a visual diff software like meld in order to compare your project directory vs the new application directory. You can find that common files like BuildConfig.groovy or Config.groovy could to need massive corrections. There are another files that you should to review after the migration.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top