Hi Scott

Could you provide a quickstart? I have some time tomorrow...

Scott Swank wrote:
I have subclassed ComponentStringResourceLoader so that I can drive it
from a custom ResourceNameIterator (in particular to look in the right
directories).  In particular, I just overrode

   public String loadStringResource(Class clazz, final String key,
final Locale locale, final String style)

and only changed the line

   ResourceNameIterator iter = new ResourceNameIterator(path, style,
locale, "properties,xml");

to use our iterator.  Now it cannot find myApplication.properties and
I am at a bit of a loss as how this class ever got to
myApplication.properties.  When it is constructing its list of
components it clearly stops at the Page and I don't see how it would
ever get to the Application.

        private List getComponentStack(final Component component)
        {
                // Build the search stack
                final List searchStack = new ArrayList();
                searchStack.add(component.getClass());

                if (!(component instanceof Page))
                {
                        // Add all the component on the way to the Page
                        MarkupContainer container = component.getParent();
                        while (container != null)
                        {
                                searchStack.add(container.getClass());
                                if (container instanceof Page)
                                {
                                        break;
                                }

                                container = container.getParent();
                        }
                }
                return searchStack;
        }

What am I missing?

Thank you,
Scott

On Tue, Apr 15, 2008 at 12:30 PM, Scott Swank <[EMAIL PROTECTED]> wrote:
Previously we retrieved the CompoundResourceStreamLocator and added
 our ResourceStreamLocator to it.  In 1.2 did this take care of
 StringResourceLoader too?

   WebApplicationPath resourceFinder = (WebApplicationPath)
 getResourceSettings().getResourceFinder();
   resourceFinder.add(Env.getInstance().getAthenaDocRoot());

   CompoundResourceStreamLocator locator =
 (CompoundResourceStreamLocator)
 getResourceSettings().getResourceStreamLocator();
   locator.add(0, new WebPageResourceStreamLocator(resourceFinder));

 Thank you,
 Scott




 On Tue, Apr 15, 2008 at 10:55 AM, Scott Swank <[EMAIL PROTECTED]> wrote:
 > We are finally upgrading to Wicket 1.3 (in particular to 1.3.3 from
 >  1.2.6) and our StringResourceModels can no longer find their property
 >  files, which leaves our web pages containing the following:
 >
 >     [Warning: String resource for 'tickets' not found]
 >
 >  Our application init method contains:
 >
 >    IResourceFinder finder = getResourceSettings().getResourceFinder();
 >    IResourceStreamLocator streamLocator = new
 >  WebPageResourceStreamLocator(finder);
 >    getResourceSettings().setResourceStreamLocator(streamLocator);
 >
 >  and in our ResourceStreamLocator I added the following with a break
 >  point on the System.out line:
 >
 >    public IResourceStream locate(final Class clazz, String path, final
 >  String variationAndStyle, final Locale locale, String extension)
 >    {
 >       if (!"html".equals(extension) && !path.endsWith(".js") &&
 >  !path.endsWith(".css"))
 >       {
 >          System.out.println("break");
 >       }
 >    ...
 >
 >  I never see the locate() method called in an attempt to find the
 >  properties.  Where should I be looking?
 >
 >  Thank you,
 >  Scott
 >


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to