Hi Greg,

On Montag, 7. Februar 2011, Grégory Joseph wrote:
> Jörg,
> 
> Confusingly enough, ${webapp} is a property that's used when resolving the
> paths to the magnolia.properties files (i.e when "parsing" the string
> containing the list of said files in web.xml); the corresponding variable
> you can use in properties files is ${magnolia.webapp}.

I already assumed it, but I did not wanted to try it again on the production 
server ;-)

> This corresponds to
> the name of the folder into which Magnolia is deployed (typically
> "magnoliaAuthor" on Tomcat). Similarly, ${servername} will correspond to
> ${magnolia.servername}, and you also have ${magnolia.app.rootdir} which is
> the full path to the deployed app. In 5.0, you'll also have
> ${magnolia.contextpath}

Hehehe, I knew there were more.

> If you get a chance though, could you plug your debugger into
> info.magnolia.cms.servlets.MgnlServletContextListener#initWebappName and
> info.magnolia.cms.beans.config.PropertiesInitializer#parseStringValue,
> because afaik, unknown properties (which should be the case for ${webapp}
> iirc) should not be substituted, and "webapp" should never be empty
> anyway... ? Just curious.

Both methods work fine in the debugger, the expression is simply kept. I tried 
to append "${webapp}/" to the log path and the log files are nevertheless 
still on the same location and are written. The replacement must happen at a 
later stage, probably somewhere when the string is turned into a real path or 
File object ?!?

BTW: The functionality of initWebappName gave me some grieves on the weekend, 
because my Tomcat on production always created a temporary copy of the webapp 
with a prepended numbering ("x-webapp" with x depending on the deploying 
sequence number of the deployed webapps). While you can set the Magnolia paths 
to absolute locations by default, it is worse for the configuration itself, 
because "<webapp>/magnolia.properties" is never found. It turned out that the 
behavior in Tomcat was triggered by the "antiResourceLocking" parameter of the 
container context (http://tomcat.apache.org/tomcat-6.0-
doc/config/context.html#Standard_Implementation). It is notable that the 
standard Magnolia war can never initialize its two instances properly if that 
parameter is active.

Cheers,
Jörg


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to