al Message -
From:
Stephen Ting
To: [EMAIL PROTECTED]
Sent: Friday, January 24, 2003 7:30
PM
Subject: RE: [JBoss-user] Access files in
a war archive
How
to create a exploded WAR? FYI, i used ANT to create the war archive and there
is no JAR file included except in th
2003 01:59To:
[EMAIL PROTECTED]Subject: RE: [JBoss-user] Access
files in a war archive
getRealPath works if the WAR is deployed as an exploded WAR (aka
directory structure, no JAR file).
-Original Message-From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf
]Subject: Re: [JBoss-user] Access
files in a war archive
There is no "real" path access from a war so
the null return value is unfortunately correct: bin-there-dun-that. URL's will
work but you will have to convert your file to an URL based on
the session context:
iginal Message -
From:
Stephen Ting
To: 'Jboss Mailing List'
Sent: Thursday, January 23, 2003 10:32
PM
Subject: [JBoss-user] Access files in a
war archive
Can anyone show me
how access a xml file in .war archive through a relative path?
Here is an example that gets a URL to the file
"myxmlfile.xml" that is contained in the war's
WEB-INF/xml directory:
String xmlFile =
getServletContext().getResource("/WEB-INF/xml/myxmlfile.xml").toString();
Depending on your XML library you might be able to
open it directly passing this URL (JDO
Title: Message
Can anyone show me
how access a xml file in .war archive through a relative path?
I try using the
following codes but in vain.
servlet.getServletContext().getRealPath(pathname) which return null;
servlet.getServletContext().getResourceAsStream(pathname)
also
Thanks
regard