BEA Logo BEA WebLogic Server

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

BEA WebLogic Server™ Quick Start Guide

This page provides instructions on how to quickly deploy JSP files, HTML files, images, and servlets. The procedures described here use a default configuration of WebLogic Server that is available for you to use for evaluation and development after installing WebLogic Server.

These procedures are not recommended for use in a production environment; instead you should develop your application by utilizing the Java Two Enterprise Edition (J2EE) model for application deployment. J2EE applications provide a consistent, portable, and easily maintainable way to deploy your applications.

You can find additional information on developing applications for WebLogic Server in the book Developing WebLogic Server Applications.

You must complete the WebLogic Server Installation before using these quick start procedures.

 

JSP Quick Start

To quickly deploy a simple JSP:

  1. Make sure your JSP file does not reference a tag library or other external resources -- such resources require additional steps to deploy that are beyond the scope of this quick start guide.

  2. Start the default Administration WebLogic Server. Windows NT users can use the Start Menu shortcut labeled "Start Default Admin Server".

  3. Copy your JSP file into the
    config/mydomain/applications/
     DefaultWebApp_myserver
    directory of your WebLogic Server installation.

    (Where mydomain is the name you specified as the WebLogic Admin Domain Name during installation and myserver is the Server Name you specified during installation.)

    You can use one of the JSP files in the examples provided with the WebLogic Server distribution. If you have installed the examples, you can try the following file, located in your WebLogic Server distribution: samples/examples/jsp/HelloWorld.jsp

  4. Use a web browser to request the JSP file using the following URL:

    http://localhost:7001/myJSPfile.jsp

    where:

    localhost is the host name of the machine running WebLogic Server

    port is the port number where WebLogic Server is listening for requests.

    myJSPfile.jsp is the JSP file you copied in step # 3


What's going on?

The directory into which you copied your JSP file is the root directory of a default Web Application that is created for you by WebLogic Server. A Web Application is a J2EE deployment unit that ties together resources of a web-based application. The root directory of a Web Application is analogous to the document root of many Web servers.

You can deploy JSP files by simply copying them into the root directory of a deployed Web Application. JSPs do not require specific registrations, as do servlets.


Additional Resources

HTML Quick Start

To quickly deploy an HTML page:

  1. Start the default Administration WebLogic Server. Windows NT users can use the Start Menu shortcut labeled "Start Default Admin Server".

  2. Copy your HTML file into the
    config/mydomain/applications/
     DefaultWebApp_myserver
    directory of your WebLogic Server installation.

    (Where mydomain is the name you specified as the WebLogic Admin Domain Name during installation and myserver is the Server Name you specified during installation.)

  3. If you have any image files or other files linked to your HTML page, also copy those into the DefaultWebApp_myserver directory. If necessary, you can create subdirectories to handle relative links, such as image files.

  4. Use a web browser to request the HTML file using the following URL:

    http://localhost:7001/myFile.html

    where:

    localhost is the host name of the machine running WebLogic Server

    port is the port number where WebLogic Server is listening for requests.

    myFile.html is the HTML file you copied in step # 2


What's going on?

The directory into which you copied your HTML file is the root directory of a default Web Application that is created for you by WebLogic Server. A Web Application is a J2EE deployment unit that ties together resources of a web-based application. The root directory of a Web Application is analagous to the document root of many Web servers.

Additional Resources

Servlet Quick Start

To quickly deploy a servlet:

  1. Create a subdirectory called classes under the following directory in your WebLogic Server installation:
    config/mydomain/applications/
     DefaultWebApp_myserver/
     WEB-INF/

  2. Copy your servlet class file into the following directory:
    config/mydomain/applications/
     DefaultWebApp_myserver/
     WEB-INF/classes
    .

    (Where mydomain is the name you specified as the WebLogic Admin Domain Name during installation and myserver is the Server Name you specified during installation.)

    If your servlet class has a package statement, you must create an additional subdirectory for each level of the package statement. For example, if your package statement is:
    Package color.blue, then place your servlet class in the following directory:
    config/mydomain/applications/
     DefaultWebApp_myserver/
     WEB-INF/classes/color/blue
    .

    If you do not have a servlet class to use for this quick start, and you have installed the WebLogic Server examples, you can use one of the servlets in the examples provided with the WebLogic Server distribution, located in the following directory of your WebLogic Server installation:
    config/examples/applications/
     examplesWebApp/WEB-INF/classes/
     examples/servlets/
     HelloWorldServlet.class
    .

  3. Modify the web.xml file located in the config/mydomain/applications/
     DefaultWebApp_myserver/
     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>
        package.name.myServlet
      </servlet-class>
    </servlet>
    
    <servlet-mapping>
      <servlet-name>
        myServlet
      </servlet-name>
      <url-pattern>
        quickStartServlet
      </url-pattern>
    </servlet-mapping>  
    where:
    myServlet is the name of your servlet class file and
    package.name.myServlet is the full package name of your servlet class.

  4. Save the web.xml file.

  5. Start the default Administration WebLogic Server. Windows NT users can use the Start Menu shortcut labeled "Start Default Admin Server".

  6. Call your servlet from a Web browser with the following URL:

    http://localhost:7001/quickStartServlet

    where:
    localhost is the host name of the machine running WebLogic Server

    port is the port number where WebLogic Server is listening for requests.

    quickStartServlet is the value of the <url-pattern> element that you defined in the web.xml file in step # 3.


What's Going On?

The web.xml file that you edited is the deployment descriptor for a Web Application called DefaultWebApp_myserver. A Web Application is a J2EE deployment unit that ties together resources of a web-based application. The DefaultWebApp_myserver Web Application is created by default when WebLogic Server starts up, if no other Web Applications have been defined.

In the deployment descriptor you defined the class name of the servlet (the <servlet-class> element) and the URL that is used to resolve requests for the servlet (the <url-pattern> element).


Additional Resources