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 = 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(); > >ServletContext context = >cycle.getRequestContext().getServlet().getServletContext(); > >String somefile = contextPath +"abc.zip"; > >String outFileName = context.getResource(somfile).getFile(); > > > >This return a null value for context.getResource(somfile). I tried >getRealPath(), it worked, but it was deprecated. Anybody knows what the >problem is here? Or there are some other better ways? > > > >Many Thanks. > > > >Henry > > > > -- Ivano Pagano --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]