tomcat or 其他的jsp容器

解决方案 »

  1.   

    初学建议去www.caucho.com下载resin,不用安装,解压后就可以使用了。
      

  2.   

    package work;import javax.naming.*;
    import java.util.Properties;
    import javax.rmi.PortableRemoteObject;
    import java.util.ArrayList;public class DoThingsTestClient1
        extends Object {
      private static final String ERROR_NULL_REMOTE = "Remote interface reference is null.  It must be created by calling one of the Home interface methods first.";
      private static final int MAX_OUTPUT_LINE_LENGTH = 100;
      private boolean logging = true;
      private DoThingsHome doThingsHome = null;
      private DoThings doThings = null;  //Construct the EJB test client
      public DoThingsTestClient1() {
        initialize();
      }  public void initialize() {
        long startTime = 0;
        if (logging) {
          log("Initializing bean access.");
          startTime = System.currentTimeMillis();
        }    try {
          //get naming context
          Context context = getInitialContext();      //look up jndi name
          Object ref = context.lookup("DoThings");
          //look up jndi name and cast to Home interface
          doThingsHome = (DoThingsHome) PortableRemoteObject.narrow(ref,
              DoThingsHome.class);
          if (logging) {
            long endTime = System.currentTimeMillis();
            log("Succeeded initializing bean access through Home interface.");
            log("Execution time: " + (endTime - startTime) + " ms.");
          }
        }
        catch (Exception e) {
          if (logging) {
            log("Failed initializing bean access.");
          }
          e.printStackTrace();
        }
      }  private Context getInitialContext() throws Exception {
        String url = "t3://localhost:7001";
        String user = null;
        String password = null;
        Properties properties = null;
        try {
          properties = new Properties();
          properties.put(Context.INITIAL_CONTEXT_FACTORY,
                         "weblogic.jndi.WLInitialContextFactory");
          properties.put(Context.PROVIDER_URL, url);
          if (user != null) {
            properties.put(Context.SECURITY_PRINCIPAL, user);
            properties.put(Context.SECURITY_CREDENTIALS,
                           password == null ? "" : password);
          }      return new InitialContext(properties);
        }
        catch (Exception e) {
          log("Unable to connect to WebLogic server at " + url);
          log("Please make sure that the server is running.");
          throw e;
        }
      }以前的程序的一部分希望对你有帮助]
      

  3.   

    好的,我按照你说的方法下载了一个名叫resin-3.0.3.zip的文件,行吗??
      

  4.   

    建议用tomcat,去http://apache.linuxforum.net/dist/jakarta/tomcat-4/tomcat-4.1.27.zip下载,解压后安装,一路next,简单之极,连设置都不用,网上支持比resin也多,建议