Main Content

Magnolia Community Forums: Get help with Magnolia: Resource reloading for module


  • mnicklisch
    mnicklisch
    Full name: Matthias Nicklisch
    Posts: 6
    Last post: Mar 9, 2017 11:37:39 AM
    Registered on: Feb 23, 2017
    Resource reloading for module
    #1 by mnicklisch on Mar 8, 2017 11:02:29 AM

    Hey,

    I am currently developing a custom module and I have lots of problems with the resource reloading mechanism of Magnolia.

    I am using a blossom module inside an empty-webapp project in Eclipse.

    Several files are not updated during development. To get the current state of the file on the server I have to redeploy the whole application, that means I have to clean the Tomcat completely, which also means that I have to do the setup every time.

    More specific, I am working on an app with some custom fields. I saw that I have to provide a css via the @Stylesheet annotation in my custom field class and that file has to be located in a directory in my src/main/resources folder with the structure corresponding to my package hierarchy. It works, but magnolia doesn't reload the file, only when I do a complete redeploy. That costs lots of time. There must be a better way to do this.

    Is there a way to reload this file fast? Or at least edit it on the server? I found the file in the resources app of magnolia, and I can edit it there, but the changes aren't applied when I open the app to test my changes. Or is there another way to provide the css file so that it is available for the app?

    The same applies for *.jsp files. I am using Blossom and I develop a custom component with a jsp template. This file is located in mgnl-files/templates/modulename/components
    This file is also not reloaded without a complete redeploy.

    I really hope you have an idea how to solve this.

    Thanks in advance

    Matthias

  • mgeljic
    mgeljic
    Full name: Mikaël Geljić
    Posts: 66
    Last post: Mar 8, 2017 12:59:14 PM
    Re: Resource reloading for module
    #2 by mgeljic on Mar 8, 2017 12:59:14 PM

    Hi Matthias,

    For Vaadin resources, you may set the resourceCacheTime init-parameter to 0 (defaults to 1h);
    Should work from /server/filters/servlets/AdminCentral/parameters, alternatively as context-params through web.xml? (that's where we set Vaadin's productionMode already).

    For JSPs, they have to be recompiled; there's a refresh delay configuration in Tomcat as well, it seems (via http://stackoverflow.com/questions/2004676/why-are-my-jsp-changes-are-not-reflected-without-restarting-tomcat). There's a similar setting for Freemarker (templateUpdateDelay) which we set if magnolia is in dev mode.

    Cheers,
    Mika

  • mnicklisch
    mnicklisch
    Full name: Matthias Nicklisch
    Posts: 6
    Last post: Mar 9, 2017 11:37:39 AM
    Registered on: Feb 23, 2017
    Re: Resource reloading for module
    #3 by mnicklisch on Mar 8, 2017 1:30:37 PM

    Ahh, this worked for me. Thank you very much, you spared me a lot of pain =)

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/