I still want to use wicket message resource tags in my markup.  But, I
need a system to load and reload resources property data for each page
and request.
Or maybe load properties per user session.  Is this possible using
Wicket resource loader classes.
 
Ideally, it looks like I should use a collection of labels, but I have
code to use the wicket message tags.  Can I have wicket messages
reloaded at each page/request?
 
This is what I am doing now, loading a property file on startup/init.
But
---------
 
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.InvalidPropertiesFormatException;
import java.util.Locale;
import java.util.Properties;
 
import org.apache.wicket.Component;
import org.apache.wicket.resource.loader.IStringResourceLoader;
 

public class MyResourceLoader implements IStringResourceLoader {
 
 private Properties properties = new Properties();
 
 public void loadProperties() {
  
  final BufferedInputStream bis = new BufferedInputStream(new
ByteArrayInputStream(DevelopmentResources.XML_PROPS.getBytes()));
  try {
   properties.loadFromXML(bis);
  } catch (Exception e) {
   e.printStackTrace();   
  } finally {
   try {
    bis.close();
   } catch (IOException e) {
   }
  } // End of try finally //
 }
 
...
...
 
}
 
Berlin Brown

Reply via email to