tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Durham David Cntr 805CSS/SCBE" <>
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: []
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..... 


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

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

> -----Original Message-----
> 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:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message