Step-By-Step How to create a Servlet and deploy it to WebLogic 5.1.0

Creating a Servlet


Find

Replace

//Write your code here

out.println("Hello world");

Now you are ready to deploy this Servlet to Weblogic 5.1.0

Compiling and running a Servlet


Find

Replace

#weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet

weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet

Note: Alternatively you can start Weblogic Server 5.1.0 from the Windows Start | Programs | Weblogic 5.1.0 | Weblogic Server.

//WLS51: Finished with 0 Errors, 0 Warnings.//

Note: To be sure your created .jar file was successfully deployed to Weblogic server, go to the server console. If the console displays
EJB home interface: 'hello.HelloHome' deployed bound to the JNDI name: 'hello.HelloHome' "
 it means that our bean is successfully deployed.

Running the Servlet

Open your browser and set address http://localhost/servlets/hello/HelloWorldServlet. You should see "Hello World".