In Weblogic, you must register the Servlet before using it. How can you register the Servlet? Adi's reference to SUN's documentation http://java.sun.com/j2ee/dtds/web-app_2_2.dtd is summarized as follows:
Find the file web. xml in the c: \ bea \ wlserver6.0sp1 \ config \ mydomain \ applications \ defawebwebapp_myserver \ web-inf \ directory and open it in notepad. The following content is displayed:
- <?xml version="1.0" ?>
- <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2
//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
- <web-app>
- </web-app>
We want to modify this content. Refer to SUN's explanation of each element in the document. The Modification result is as follows:
- <?xml version="1.0" ?>
- <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
- <web-app>
- <servlet>
- <servlet-name>TestUseServlet</servlet-name>
- <servlet-class>testservlet.TestUseServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>TestUseServlet</servlet-name>
- <url-pattern>DBTest</url-pattern>
- </servlet-mapping>
-
- <servlet>
- <servlet-name>Myservlet</servlet-name>
- <servlet-class>mypackage.Myservlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>Myservlet</servlet-name>
- <url-pattern>Myservlet</url-pattern>
- </servlet-mapping>
- </web-app>
The above is the Servlet registration method.
- New Servlet and JSP features
- Talking about Servlet Web Server
- Implement Servlet applications in Weblogic
- Communication between Servlet and CGI
- Use MIDlet to activate Servlet