I checked out the struts 2 source and added more logging so ensure the 
properties are getting loaded and they are.

There must not be a way to reference the property from a jsp is my guess.

<s:text> can only grab properties loaded using the setting: 
struts.custom.i18n.resource

Please let me know if this is correct.

Thank you.

Mitch



From:   mmcken...@wernervas.com
To:     user@struts.apache.org
Date:   06/10/2011 12:13 PM
Subject:        struts.custom.properties not working



I have some custom properties I want available in my application. 
Unfortunately,  I am unable to get the properties to work in struts 2.2.3

My property file is located:  WEB-INF\classes\test.properties

Contents of test.properties:

theme.debug.value = true
static.content.server.url = /static
jquery.core.version = 1.6.1
jquery.ui.version = 1.8.13
jquery.ui.external.bgiframe.version = 2.1.2


My struts.properties file contains the following property:

struts.custom.properties=test


Here is how I'm attempting to reference the property:

<s:text name="static.content.server.url" />

I also looked at the struts2 source to make sure I am using the property 
correctly (package org.apache.struts2.config.SettingsTest ).

Judging from this test class it appears that I am:

    public void testSettings() {
        assertEquals("12345", Settings.get(StrutsConstants.
STRUTS_MULTIPART_MAXSIZE));
        assertEquals("\temp", Settings.get(StrutsConstants.
STRUTS_MULTIPART_SAVEDIR));

        assertEquals("test,org/apache/struts2/othertest", Settings.get( 
StrutsConstants.STRUTS_CUSTOM_PROPERTIES));
        assertEquals("testvalue", Settings.get("testkey"));
        assertEquals("othertestvalue", Settings.get("othertestkey"));

        int count = getKeyCount();
        assertEquals(12, count);
    }


Is there a way to expose what properties are available for reference?

What am I missing here?

Thank you.

Mitch

Reply via email to