在cao中一定要有WEB-INF目录,在WEB-INF内一定要有WEB.XML数据
访问的时候 http://localhost:8080/cao/index.hj

解决方案 »

  1.   

    $tomcat_home$/conf/server.xml
    查询<Context path="/examples"
    将下面的话这段话上面
    <Context path="/cao" docBase="D:/cao" debug="0"
                     reloadable="true" crossContext="true"/> 
    path网页路径
    docBase文档地址
    http://localhost:8080/cao/
    即可访问
      

  2.   

    当我运行http://localhost:8080/crm/add.jsp时,提示如下错误:
    org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 34 in the jsp file: /add.jspGenerated servlet error:
        [javac] Compiling 1 source fileD:\Tomcat 4.1\work\Standalone\localhost\crm\add_jsp.java:104: non-static method executeInsert(java.lang.String) cannot be referenced from a static context
           test1.executeInsert(sql);
                ^
    1 error
    我想大概是web.xml的错误,用到了servlet,请问:那位师兄能够提供一份完整的web.xml文件(加注释),在下感激不尽,并赠分50。谢谢
      

  3.   

    test1.executeInsert(sql);
    什么web.xml错误啊
    不要想当然
    明显是你的test1类里面的方法executeInsert(sql)不是静态的方法
      

  4.   

    test1类里面的方法executeInsert(sql):
    //增加记录
            public void executeInsert(String sql)
            {
             try
             {
             conn = DriverManager.getConnection(sConnStr);
             Statement stmt = conn.createStatement();
             stmt.executeInsert(sql);
             }
             catch(SQLException ex)
             {
             System.err.println("testbean.executeInsert:"+ex.getMessage());
             }
            }
    还请师兄多多请教
      

  5.   

    http://localhost:8080/新建文件夹/文件名.jsp