BEA Logo BEA WebLogic Server

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

BEA WebLogic Server™ Fast Track for Web Applications

This page provides basic instructions for deploying JSP files, HTML files, images, and servlets. The procedures described here use a default configuration of WebLogic Server that you can use for evaluation and development after you install WebLogic Server.

These procedures are not recommended for a production environment. Instead, use the J2EE™ model, described in Guidelines, Patterns, and Code for End-To-End Java™ Applications, for procedures to develop your production application. The J2EE application model enables you to develop and deploy applications that are consistent, portable, and easily maintained.

For additional information on developing applications for WebLogic Server, see Developing WebLogic Server Applications.

Complete the WebLogic Server Installation before using these Fast Track procedures.

 

JSP Fast Track

To 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 these Fast Track procedures.

    If you do not have a JSP available, you can use one of the JSP files in the examples provided with the WebLogic Server distribution. If you have installed the examples, try the following file:
    WL_HOME\samples\examples\jsp\
     HelloWorld.jsp
    ,
    where WL_HOME is the directory of your WebLogic installation.

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

  3. Copy your JSP file into the
    WL_HOME\config\mydomain\
     applications\DefaultWebApp
    .

    (Where WL_HOME is the directory of your WebLogic Server installation, and mydomain is the name you specified as the WebLogic Admin Domain Name during installation.)

  4. In a Web browser, request the JSP file using the following URL:

    http://localhost:port/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 preconfigured in your WebLogic Server installation. 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 Fast Track

To deploy an HTML page:

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

  2. Copy your HTML file into the
    WL_HOME\config\mydomain\
     applications\DefaultWebApp
    directory of your WebLogic Server installation.

    (Where WL_HOME is the directory of your WebLogic Server installation and mydomain is the name you specified as the WebLogic Admin Domain Name during installation.)

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

  4. In a Web browser, request the HTML file using the following URL:

    http://localhost:port/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 preconfigured in your WebLogic Server installation. 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 Fast Track

To deploy a servlet:

  1. Create a subdirectory called classes under the following directory:
    WL_HOME\config\mydomain\applications\
     DefaultWebApp\WEB-INF\
    .

    (Where WL_HOME is the directory of your WebLogic Server installation and mydomain is the name you specified as the WebLogic Admin Domain Name d uring installation.)

  2. Copy your servlet class file into the following directory:
    WL_HOME\config\mydomain\
     applications\DefaultWebApp\
     WEB-INF\classes
    .

    If your servlet class has a package statement, 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:
    WL_HOME\config\mydomain\
     applications\DefaultWebApp\
     WEB-INF\classes\color\blue
    .

    If you do not have a servlet class to use for this Fast Track procedure, and you have installed the WebLogic Server examples, try the following file: WL_HOME\config\examples\
     applications\examplesWebApp\
     WEB-INF\classes\examples\servlets\
     HelloWorldServlet.class
    .

  3. Modify the web.xml file located in the WL_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>
        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.

    package.name.myServlet is the full package name of your servlet class.

  4. Save the web.xml file.

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

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

    http://localhost:port/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. A Web Application is a J2EE deployment unit that ties together resources of a Web-based application. The DefaultWebApp Web Application is preconfigured in your WebLogic Server installation.

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