tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "smashingwebs" <smashingw...@home.com>
Subject Re: data file read quandry
Date Tue, 30 Oct 2001 00:37:15 GMT
That was the problem! I needed to put the data in a
file outside of tomcat and put the full path in. Now the
bean found it and it works! Thanks for your help Martin!

----- Original Message -----
From: "Martin van den Bemt" <martin@isallineed.org>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Sunday, October 28, 2001 11:26 PM
Subject: RE: data file read quandry


> Specifying a path might help. You're trying to read that file from the
> current directory.. (all our data and config files reside outside tomcat
and
> never had a problem with that). If you use the securitymanager, you have
to
> change the security settings so it actually has access to the files (or
> directory) you want.
>
> Mvgr,
> Martin
>
> > -----Original Message-----
> > From: Frank Graham [mailto:frankgraham44@hotmail.com]
> > Sent: Monday, October 29, 2001 6:31 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: data file read quandry
> >
> >
> > Hi I posted an email before but it was before
> > I joined the mailing list so I don't know if
> > it got through. My problem is that I am trying
> > to get a bean to read in a .txt file but its
> > not working. Either it cant find the file, or
> > it wont read in the file for some reason. Its
> > funny cause it works fine when I tested it in
> > my jdk. Is there some special place in tomcat
> > where I should put the data file? Here is
> > my bean code:
> > package mynewdev;
> >
> > import java.util.Vector;
> > import java.io.*;
> >
> > public class DataFileReader {
> >
> > public Vector vect;
> >
> > public DataFileReader(){
> >
> > vect = new Vector();
> >
> > }
> >
> > public void readfile() throws Exception {
> >
> >    FileReader fr = new FileReader("DataTable.txt");
> >    BufferedReader br = new BufferedReader(fr);
> >    String s;
> >
> >    while((s = br.readLine()) != null) {
> >
> >    vect.addElement(s);
> >
> >    }
> >
> >    fr.close();
> >
> >    }
> >
> > public String[] getItems(){
> >
> >     String as[] = new String[vect.size()];
> >     vect.copyInto(as);
> >     return as;
> >    }
> > }
> > Any help would be appreciated!
> >
> > _________________________________________________________________
> > Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message