> JSP page:
> <%@ page import="my.pkg.Class" %>
>
> Class source:
>         try {
>             InputStream is =
> this.getClass().getResourceAsStream(File.separatorChar +
"Prop.properties");
>             this.props.load(is);
>         } catch( Throwable t ) {
>         }

Not sure about this method since we just use ResourceBundle and it does all
of the classpath searching for us:

       try
        {
            // if you put Prop.properties in your base
WEB-INF/classes/Prop.properties
            java.util.ResouceBundle bundle =
java.util.ResourceBundle.getBundle("Prop"); // the .properties is assumed

            // or if you put Prop.properties in a package name:
WEB-INF/classes/com/host/config/Prop.properties
            java.util.ResouceBundle bundle =
java.util.ResourceBundle.getBundle("com.host.config.Prop"); // the
.properties is assumed
            java.util.Enumeration keys = bundle.getKeys();

            String oneProp = bundle.getString("oneprop");
        }
        catch( java.util.MissingResourceException e )
        {
            String msg = "PropertiesFile - Could not load properties file '"
+ bundleName + "': " + e.getMessage();
            throw e;
        }


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

Reply via email to