Hello:
I have a problem when use with gwt 1.6 web mode, because not found
file.properties.
When we used gwt 1.4 with tomcat, we have the file.properties in the
folowing directory (in workspace eclipse):
project.tomcat.webapps.confFiles.
But i do not know in gwt 1.6 where to put for what in web mode
recognize the properties.
I have a server class DataBaseAccessProperties.java in this class i
have the folowing code:
******************************************************************************************************************************************************
package com.accesa.portal.server;
import java.util.Properties;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
public class DataBaseAccessProperties
{
private static DataBaseAccessProperties dbm=null;
private static Properties prop = new Properties();
private String path ="";
private DataBaseAccessProperties(String path)
{
this.path =path;
}
public static Properties getDataBaseProperties(String path)
{
if (dbm==null)
{
dbm = new DataBaseAccessProperties(path);
return dbm.loadData();
}
else
{
return prop;
}
}
private String getPropertieFilePath()
{
String to="";
try {
// search excelFile folder under webapps folder
File startFile = new File(this.path);
if (startFile.isDirectory())
{
File browseFile = new
File(startFile.getParent());
while
(!browseFile.getName().equals("webapps"))
{
browseFile = new
File(browseFile.getParent());
}
String [] list = browseFile.list();
boolean notFound=true;
int h=0;
File excelFile = null;
while (h<list.length && notFound)
{
excelFile = new
File(browseFile.getAbsolutePath()
+browseFile.separator+list[h]);
if
(excelFile.getName().equals("confFiles"))
{
notFound=false;
}
h++;
}
to =
excelFile.getAbsolutePath().replaceAll("%20"," ")+
excelFile.separator;
}
}
catch (Exception e)
{
e.printStackTrace();
}
return to;
}
private Properties loadData()
{
try
{
File file = new
File(getPropertieFilePath()+"file.properties");
InputStream is = new FileInputStream(file);
prop.load(is);
is.close();
}catch(Exception ex)
{
ex.toString();
}
return prop;
}
}
***************************************************************************************************************************************************************
works ok with gwt 1.5 but do not works gwt 1.6.
Sorry for the writing, but i am not speak english
Thanks
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.