Resin 自带了很多种身份验证机制, 例如纯文本, XML 和 JDBC 格式的等等, 详见 Resin 安装后自带的 resin-doc 里的网页. 这样一来如果我们想给某些页面加入密码保护机制, 就很容易了. 最典型的例子例如本站使用的是 JSPWiki 2.2.33, 它自身没有带严格的身份验证机制, 这样一来如果放到公网上, 就会非常危险. 例如说原来没有开放的时候我只想一个人来编辑, 就可以做如下的配置(修改 WEB-INF/web.xml): 
 <!-- Add user names and passwords that can edit the wiki -->
 <!-- Add user names and passwords that can edit the wiki -->
 <authenticator type="com.caucho.server.security.XmlAuthenticator">
  <authenticator type="com.caucho.server.security.XmlAuthenticator">
 <init>
    <init>
 <!-- 可以加入多个 user, 格式: < user >用户名:密码:角色< / user > -->
<!-- 可以加入多个 user, 格式: < user >用户名:密码:角色< / user > -->
 <user>adminuser:password:admin</user>
      <user>adminuser:password:admin</user>
 <password-digest>none</password-digest>
      <password-digest>none</password-digest>
 </init>
    </init>
 </authenticator>
  </authenticator>
 <!--指定验证方式为 basic, 就是浏览器弹出对话框的那种 -->
<!--指定验证方式为 basic, 就是浏览器弹出对话框的那种 -->
 <login-config auth-method='basic'/>
 <login-config auth-method='basic'/>
 <!--被保护的页面地址及其响应的角色名 -->
<!--被保护的页面地址及其响应的角色名 -->
 <security-constraint url-pattern='/Delete.jsp' role-name='admin'/>
  <security-constraint url-pattern='/Delete.jsp' role-name='admin'/>

这时候点击 Delete.jsp 后, 系统就会弹出窗口要求您进行身份验证. 是不是很简单呢?