The putMethod is probably failing because you're trying to put the contents of SlideTest.java to /slide/files. /slide/files is a collection, so that's not going to work. You either need to build your WebdavResource to point to /slide/files/SlideTest.java, or you need to use one of the putMethod()s that takes a path argument.
As for the error message, you're probably seeing that because http://localhost:8080/slide/files is not a valid url after you change the servlet mapping. You need to change the url to be http://localhost:8080/slide/ without the "files". -James >>> [EMAIL PROTECTED] 7/26/2004 4:53:13 PM >>> Hello, I have downloaded the binary of slide 2.0 included tomcat 5.0.19. I was able to run the startup.bat and view/log-in through http://localhost:8080/slide and see a listing. I then ran my sample program (at bottom of this e-mail) and saw the output of WebdavResource exists, File is OK, and putMethod() Failed. I then edited the web.xml file to only list the /files directory. through the web and http://localhost:8080/slide I see that the directory is currently empty and have nothing in it. I then ran my sample program again, and got this exception: org.apache.commons.httpclient.HttpException at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3185) at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3145) at org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:879) at org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.java:824) at org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1746) at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1156) at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1175) at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1261) at org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:274) at SlideTest.main(SlideTest.java:15) Cause null My questions are: why is putMethod() keep on failing on me? And why do I get the exception error when I modified the web.xml to only list /files? Why is that I am able to see the web page after I modified the web.xml but yet my sample program fails? Here is my sample program:: import java.io.*; import org.apache.commons.httpclient.*; import org.apache.webdav.lib.*; public class SlideTest { public static void main(String args[]) { try { HttpURL hrl = new HttpURL("http://localhost:8080/slide/files"); hrl.setUserinfo("root","root"); WebdavResource wdr; wdr = new WebdavResource(hrl); if(wdr.exists()) System.out.println("WebdavResource exists"); else System.out.println("WebdavResource does NOT exists"); File f = new File("SlideTest.java"); if(f.exists()) System.out.println("File is OK"); else return; if(wdr.putMethod(f)) System.out.println("putMethod() Successful"); else System.out.println("putMethod() Failed"); System.out.println("End of Test"); } catch(Exception ie) { ie.printStackTrace(); System.out.println("Cause " + ie.getCause()); } } } Thanks for any kind of hints or pointers you might offer. -- Jimmy --------------------------------------------------------------------- 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]
