Howdy.

I want to know how i can identify the root of the servlet. I have a *.txt
file with some arguments in this  root, and i read this  file  to connect
to the DB.
I have the follow code, but a java.lang.NullPointerException occurs.

public class Constantes

public static ServletContext context;

public static void createProperties(){
     try {
          public static File parametros = new File(context.getRealPath
("/netcom/parametros.txt"));
          properties=new java.util.Properties();
          properties.load(new
java.io.FileInputStream(db.Constantes.parametros));
          inserirProperties();
     } catch (Exception ex){}
}

this code is correct or can do anything else to identify the root and read
the file parametros.txt?
How  i initialize the  attribute context because he is null?

Thanks in Advance,

Lu�s Miguel Neto

IBS Portugal

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to