是的  移植后他找不到servlet
第一步:整个包拷贝过去到D:\resin3.08\doc
访问http://localhost:8081/Test4/报错。意料之中的。因为resin和tomcat的放置目录是完全不同的。第二步:重启resin,把\Test4\WEB-INF目录拷贝到D:\resin3.08\doc\,
访问http://localhost:8081/Test4/index1.jsp 这个使用的javabean。已经可以正确解释了。。然后测试http://localhost:8081/Test4/servlet/TestUserId,出错了。应该是web.xml的问题。于是把他从\Test4\WEB-INF\目录拷贝到Test4\目录,重启resin,访问http://localhost:8081/Test4/servlet/TestUserId,还是不行。提示404找不到文件。第三步:拷贝web.xml到D:\resin3.08\doc目录。重启resin。访问http://localhost:8081/Test4/servlet/TestUserId,不行,访问http://localhost:8081/servlet/TestUserId,出现正确页面。虽然是出现的正确的页面。但是这个访问地址却并不是我们希望的。而且。想起来,这个服务器上的所有项目,都要使用web.xml这个文件了。。实在是一件狠可怕的事情。。
第四步:测试。把TestUserId.class改名为1TestUserId.class,重启resin,再访问http://localhost:8081/Test4/servlet/TestUserId,报错了。错误信息如下
500 Servlet Exception
`TestUserId' is not a known servlet.  Servlets belong in the classpath,
often in WEB-INF/classes.
很明显是在WEB-INF/classes中找不到根目录下的web.xml指定的servlet。看来还是应该部署多个站点。这样就必须去修改resin.conf文件了。第四步:打开resin.conf文件。找到<host id=''>
      <document-directory>doc</document-directory>      <!-- configures the root web-app -->
      <web-app id='/'>
        <!-- adds xsl to the search path -->
        <class-loader>
          <simple-loader path="$host-root/xsl"/>
        </class-loader>        <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
      </web-app>    </host>把它修改为<host id=''>
      <document-directory>doc</document-directory>      <!-- configures the root web-app -->
      <web-app id='/'>
        <!-- adds xsl to the search path -->
        <class-loader>
          <simple-loader path="$host-root/xsl"/>
        </class-loader>        <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
      </web-app>      <!-- configures the root web-app -->
      <web-app id='/Test4/'>
        <!-- adds xsl to the search path -->
        <class-loader>
          <simple-loader path="$host-root/xsl"/>
        </class-loader>        <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
      </web-app>    </host>然后重启resin。把根目录下的web.xml剪贴到D:\resin3.08\doc\Test4\目录。访问http://localhost:8081/Test4/servlet/TestUserId。成功了。这样。就添加了一个访问地址为http://localhost:8081/Test4/的站点了。这样web.xml就可以采用tomcat的方式放在不同的文件夹中了。第五步:进行到这里。需要提一下的是,这时Test4站点的class的目录也已经变成D:\resin3.08\doc\Test4\WEB-INF了。所以其实tomcat的项目移值到resin中实际上很简单。只是需要修改resin.conf文件,而不需要更改代码的目录结构。很容易吧。