你的制定目录,不能超出你的容期的限制,如果你使用的tomcat 的话,你可以在你的工程的文件夹底下在建一层jsp的文件夹。

解决方案 »

  1.   

    我用过TOMCAT,可以建立自己的目录,我知道WEBLOGIC可以吗,我看着它的配置是在CONFIG.XML是里写着
      

  2.   

    我在默认路径下DefaultWebApp\WEB-INF\classes下建了servlet文件a.java
    修改web.xml文件如下:
    <servlet>
    <servlet-name>a</servlet-name>
    <servlet-class>a</servlet-class>
     </servlet>
     <servlet-mapping>
    <servlet-name>a</servlet-name>  
    <url-pattern>/myservlet</url-pattern> 
     </servlet-mapping>
    我输处http://localhost:7001/myservlet/a 出现错误,这是为什么?
    Error 404--Not Found 
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.
     
      

  3.   

    你的applications\下建立目录myjsp\META-INF .建立文件application.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
    <application>
      <display-name>myjsp</display-name>
      
      <module>
        <web>
          <web-uri>myjsp</web-uri>
          <context-root>myjsp</context-root>
        </web>
      </module>
    </application>新建目录myjsp/myjsp,再建web-inf
    然后在web-inf下建立web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <servlet-name>servlet name</servlet-name>
        <servlet-class>servlet class</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>servlet name</servlet-name>
        <url-pattern>/servlet name</url-pattern>
      </servlet-mapping>
    </web-app>web-inf下建立classes目录,把jb的输出路径制定为这个classes.
    ok
      

  4.   

    weblogic不可以单独调用servlet吗?是不是非得要*.war文件?
    我实在有点不懂了,我做过TOMCAT,好象调用SERVLET没这么麻烦
    用JBUILDER生成的一堆乱七八糟的东西都是做什么用的
    谢谢zez
      

  5.   

    war是为了符合j2ee规范,并不是一定要有,但如果没有,那么就应该放在规定路径下
    至少,得有个规范的根目录吧,不然j2ee服务器怎么读取呢?