You can do it in a servlet something like this
Regards,
Len
/**
* Allow us to retrieve static content
* Author: <a href="mailto:l...@guruhut.com">Len Weincier</a>
*/
public class DocServlet extends HttpServlet {
public void service(HttpServletRequest request,
HttpServletResponse response) throws IOException {
ServletContext context = getServletContext();
File file = new
File(context.getRealPath(getPath(request.getRequestURI())));
// Return a 404 if we could not find the file
if (!file.exists() || !file.canRead()) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
response.setContentType(mimeType);
response.setContentLength((int) file.length());
FileInputStream in = new FileInputStream(file);
OutputStream out = response.getOutputStream();
// Copy the contents of the file to the output stream in chunks
byte[] buf = new byte[1024];
int count = 0;
while ((count = in.read(buf)) >= 0) {
out.write(buf, 0, count);
}
in.close();
out.close();
Well if its not really xml - i.e. just for your app then you can
create your own Text/MyCustomMimeType for it
Len