post questions to the list please.  

It will work in a bean if you pass a reference to the servlet context to it.  I'm not 
all that familiar with using beans in jsp but I think that you will have to break out 
of the bean tags and actually make a method call like:  <% 
myBean.setServletContext(getServletContext()) %>


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 12, 2002 5:21 PM
To: Durham David Cntr 805CSS/SCBE
Subject: RE: Quick Question



the "getServletContext.getRealPath...." will work in a java bean?????? 

I'm trying to read a txt file from a java bean instead of a java servlet.....   then I 
use the bean in a jsp page..... 

thanks 
Alex 









Durham David Cntr 805CSS/SCBE <[EMAIL PROTECTED]> 
12/08/2002 05:12 p.m. 
Please respond to Tomcat Users List 
        
        To:        Tomcat Users List <[EMAIL PROTECTED]> 
        cc:         
        Subject:        RE: Quick Question 




getServletContext.getRealPath("/config.txt") will return the path to config.txt in the 
root of your apps directory.



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 12, 2002 5:00 PM
> To: Tomcat Users List
> Subject: Quick Question
> 
> 
> Hi all,
> 
> I wrote a simple java bean that reads a txt file, the problem 
> is where do 
> I need to put the txt file??...
> What is the default directory in Tomcat??....
> 
> when I put something like this in my java bean : 
> FileReader("config.txt").... 
> Where does tomcat look for that file?....
> 
> thanks
> Alex
> 

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

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

Reply via email to