具体一点就是怎么配 mappedServletName

解决方案 »

  1.   

    Modify the web.xml file located in the <WebLogic Home>/config/mydomain/applications/
     DefaultWebApp/
     WEB-INF/ directory of your WebLogic Server installation by adding the following, in between the <web-app> and </web-app> tags: 
    <servlet>
      <servlet-name>
        myServlet
      </servlet-name>
      <servlet-class>
        mywebapp.HelloServlet
      </servlet-class>
    </servlet><servlet-mapping>
      <servlet-name>
        myServlet
      </servlet-name>
      <url-pattern>
        quickStartServlet
      </url-pattern>
    </servlet-mapping>myServlet is the name of your servlet class file. 
    package.name.myServlet is the full package name of your servlet class. 
    Save the web.xml file. 
    your problem:
    <servlet>
      <servlet-name>
        myHelloServlet
      </servlet-name>
      <servlet-class>
        package.name.myServlet
      </servlet-class>
    </servlet><servlet-mapping>
      <servlet-name>
        myHelloServlet
      </servlet-name>
      <url-pattern>
        MyWebApp/servlet/mywebapp.HelloServlet
      </url-pattern>
    </servlet-mapping>
      

  2.   

    thanks a lot!
    但是我发现一个问题
    当在JBuilder5环境下一运行这个工程
    web.xml就回到原来的状态了,如下:<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
      <mime-mapping>
        <extension>jnlp</extension>
        <mime-type>application/x-java-jnlp-file</mime-type>
      </mime-mapping>
    </web-app>又该如何解决呢?
      

  3.   

    有可能是我搞错了,我编辑的是C:\bea\MyWebApp\WEB-INF下面的web.xml