my servlet shud get the static files such as htm,xsl etc from the .war fil

My htm , jsp or xsl files are placed under sub directories of my

appliction dir

/fcbWar / BO / 01 / eng / login.xsl

currently , this path is hard coded and i return the static files to my servlet to generate the response. This works fine.

But now , i shud get these files from my .war file that i use while deployment. I have the request , config and response object s as parametrs in my method where i shud return the file for response.

I tried this code

ServletContext sc = p_config.getServletContext();

String r = "/"+l_xsl_name; // l_xsl_name is the name of the static file

URL content = sc.getResource(r);

System.out.println(" resource content is...."+content);

String cfile = content.getFile();

l_xsl_file = new File(cfile);

return l_xsl_file;

here i get the o/p asresource content is.......null

because it does not identify the file from its sub directories.

Can anybody help me with suggestions . It is very urgent

Thank u,

mcraft

[1051 byte] By [mcrafta] at [2007-11-27 10:53:14]
# 1

Move these file into the WEB-INF classes directory where they will be in the class path and can be accessed using the Class getResourceAsStream method.

tolmanka at 2007-7-29 11:42:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...