What s Next


Resin and WebDav

WebDav, commonly called just Dav, is a Web-based authoring and versioning system that allows developers and administrators to change a supported site's primary pages using the Web itself. Most site maintainers are probably familiar with using FTP to upload changed site pages. WebDav was designed to allow multiple users to collaboratively edit and manage the pages on a remote site. You can find much more information on WebDav at www.webdav.org. Many support applications can save directly to WebDav, and some operating systems allow a filesystem link to be created directly to a WebDav-supported site.

Since we've included a section on WebDav in this book, you've probably guessed that Resin supports it. In this section, we look at setting up Resin to use WebDav and how you can interface to the supported site.

Configuring for WebDav

Resin supplies a servlet designed to support WebDav. To activate support, you must explicitly set up the servlet in the configuration file. By default, the servlet requires a user logged into the system that with the role "webdav". The connection defaults to Secure Socket Layer (SSL) for the best security when changing a site's pages. The following example shows how you might configure a WebDav servlet:

 <servlet-mapping url-pattern='/webdav/*'    servlet-name='com.caucho.servlets.webdav.WebDavServlet'>   <init-param enable='write'/> </servlet-mapping> <authenticator type="com.caucho.server.security.XmlAuthenticator">   <init>     <user>username:password:webdav</user>     <password-digest>none</password-digest>   </init> </authenticator> <login-config auth-method='basic'/> 

There are three major components to this configuration. First, note the declaration of the <servlet-mapping> element. In this element, we let Resin know that if a page is requested in the directory webdav, the WebDavServlet should be used to handle the request. Second, we set up an authenticator with a specific username, password, and role for the logged-in user. Third, we set up a <security-constraint> for all the pages within the webdav directory.

Parameters currently available for the WebDav servlet include:

  • enable— Indicates whether the servlet can read or write to the specified directory; the default is false.

  • role— Defines the required role for a user using WebDav; the default is webdav.

  • user— Specifies the user who may use WebDav; the default is none.

  • secure— Indicates whether writes must be done over SSL; the default is true.

  • root— Defines the root directory for webdav.

  • path-source— Defines a custom path.

Configuring Windows' My Network Places

It is possible to map a location with Windows' My Network Places dialog box to a WebDav-supported site. Follow these steps:

  • Step 1— Open the My Network Places dialog box.

  • Step 2— Select Tools, then Map Network Drive.

  • Step 3— Click on the link Create A Shortcut To Web Folder Or FTP Site. A dialog box appears that requests the URL to the site. Enter the site; for example, http://localhost:8080/webdav.

  • Step 4— Enter the required username and password for our configuration.

  • Step 5— Once the link has been established in your Network Neighborhood, you can save directly to the link.




Mastering Resin
Mastering Resin
ISBN: 0471431036
EAN: 2147483647
Year: 2002
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net