Re: Problem with ServletContext.getResource()

2005-05-05 Thread Kent Tong
Henry Chen gmail.com> writes: Try: ServletContext context = cycle.getRequestContext().getServlet().getServletContext(); String somefile = "/abc.zip"; //String outFileName = context.getResource(somfile).getFile(); String outFileName = context.getRealPath(somfile); As you're trying to write to

RE: Problem with ServletContext.getResource()

2005-05-05 Thread Henry Chen
This doesn't work. Even getResource(contextPath) doesn't work. -Original Message- From: Ivano [mailto:[EMAIL PROTECTED] Sent: Thursday, May 05, 2005 10:33 AM To: Tapestry users Subject: Re: Problem with ServletContext.getResource() Could it be: String somefile = c

Re: Problem with ServletContext.getResource()

2005-05-05 Thread Ivano
Could it be: String somefile = contextPath + File.separator + "abc.zip"; or about the same: String somefile = contextPath +"/abc.zip"; Henry Chen wrote: Hi, I want to write to a file. I use the following method: String contextPath = cycle.getRequestContext().getRequest().getContextPath(); Servlet

Problem with ServletContext.getResource()

2005-05-05 Thread Henry Chen
Hi, I want to write to a file. I use the following method: String contextPath = cycle.getRequestContext().getRequest().getContextPath(); ServletContext context = cycle.getRequestContext().getServlet().getServletContext(); String somefile = contextPath +"abc.zip"; String outFileName = con