Create a New Project (Main Menu | File | New Project). Enter "HelloWorld" as the project name. As you won't need standard libraries, remove them from the project: press Advanced button, select Search Classpath and make sure that check boxes 'Include standard libraries' and 'Include Classpath' are cleared. Press OK button.
Create a New Package. Name it "hello" and choose Open in New Tab from the speedmenu.
Create a new servlet "HelloWorld" using Class by Pattern icon on the toolbar.
Edit doGetmethod
|
Find |
Replace |
|
//Write your code here |
out.println("Hello world"); |
Now you are ready to deploy this Servlet to Weblogic 5.1.0
Edit weblogic.properties,
|
Find |
Replace |
|
#weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet |
weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet |
Start Weblogic Server 5.1.0:
Main Menu | Tools | EJB Deployment Expert
Select Application Server Platform: 'Start Weblogic
Application Server 5.1'.
Check 'Start Weblogic Server 5.1.0 (normal mode)'
and uncheck 'Start Weblogic Server 5.1.0 (debug mode)'. Press Next.
Set root directory of Weblogic Server 5.1.0 and press Finish button to start the server.
Note: Alternatively you can start Weblogic Server 5.1.0 from the Windows Start | Programs | Weblogic 5.1.0 | Weblogic Server.
Run Together's Main Menu | Tools | EJB Deployment Expert
Select "Weblogic Application Server 5.1" as the target server and make sure that checkboxes "Add librares, required for..." and "Process Servlet(s)" are checked, while the other check boxes are cleared. Press Next.
Set paths to jdk1.2 (e.g. c:\jdk1.2.2), Weblogic (e.g. c:\wls51) and paths where you want to place the resulting Servlet default (%WL_HOME%myserver\servletclasses) and temporary files. Press Finish.
If the compile process successfully completed, the Message Pane should display the following message:
//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.
Open your browser and set address http://localhost/servlets/hello/HelloWorldServlet. You should see "Hello World".