tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Durham David Cntr 805CSS/SCBE" <David.Durh...@scott.af.mil>
Subject RE: Quick Question
Date Wed, 14 Aug 2002 14:41:34 GMT
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: TOMITA_ALEX_NONLILLY@Lilly.com [mailto:TOMITA_ALEX_NONLILLY@Lilly.com]
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 <David.Durham1@scott.af.mil> 
12/08/2002 05:12 p.m. 
Please respond to Tomcat Users List 
        
        To:        Tomcat Users List <tomcat-user@jakarta.apache.org> 
        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: TOMITA_ALEX_NONLILLY@LILLY.COM
> [mailto:TOMITA_ALEX_NONLILLY@LILLY.COM]
> 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: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