C H A P T E R 5 |
Running, Debugging, and Deploying Your Web Application |
This chapter assumes you have considered how to develop your application. It also assumes you are ready to run, debug, and deploy your application using the IDE. The chapter provides a high-level view that ties together the tasks you perform in test running and modifying your application. Then it offers some details on individual programming tasks.
See Chapter 4 for a description of developing your web application from standard components. Such components might include JSP pages, servlets, filters, and beans.
It is recommended that you work through the Sun ONE Studio 5 Web Application Tutorial before building your own web application with IDE. The tutorial contains more information on many aspects of the web module development process.
This section provides an overview of the tasks involved in running a web module using the IDE. When working on a web application, it often makes sense to proceed in an iterative fashion. You redeploy and check that the application works each time a component or set of components is modified. You repeat this process each time you add a new component or set of components to your application. Each task refers to a section later in the chapter that provides more details. The IDE's online help for the JSP/Servlet module also provides information on these tasks.
To run a web module using the IDE:
1. Make modifications to the component (JSP page, servlet, and so forth). This process is covered for each component type in Chapter 4.
2. Configure the web module. The IDE takes care of much of the deployment configuration with default settings. Then it provides editors, called property sheets, for you to edit the deployment descriptor file. See Configuring the Web Module Deployment Descriptor.
3. Deploy the web module by right-clicking the WEB-INF node and choosing Deploy from the contextual menu.
4. Test run your application in the IDE. See Test Running Web Modules.
5. Track data flow within HTTP transactions using the HTTP Monitor window. Use the monitor to examine data sent by JSP pages and servlets, and the data within the web application. The monitor can also be used during the debugging process to replay previous requests. For additional information on using the HTTP monitor, see Using the HTTP Monitor to Debug a Web Application.
6. If necessary, debug your JSP pages, servlets, and web modules using source-level debugging. For more, see Source-Level Debugging.
7. Package the web module as a WAR file and deploy it. A web application archive is a single file that contains all of the components of a web application. For details, see Packaging Your Web Applications.
The deployment descriptor file is located in the web module's WEB-INF directory. It provides the necessary configuration information to the web module's deployment environment, that is, the servlet container. The deployment descriptor can contain descriptions of servlets, filters, or tag libraries that are used by the web application. It can also include requirements for external resources and security, environment parameters, and other component-specific and application-specific parameters.
In the IDE, you can modify the deployment descriptor file in two ways:
Some web modules are simple, containing only JSP files and servlets. To deploy simple web modules on an internal server, you might not need to change the deployment descriptor. Many changes are taken care of by the IDE, sparing you the effort. In some cases, however, you need to modify the following deployment descriptor elements:
Many other web application properties can be specified in the deployment descriptor. Refer to the Java Servlet Specification, v2.3 for details.
Note - In order for changes to the deployment descriptor to take effect, you must redeploy the web module. |
Use the web.xml property sheet to edit the various elements that make up the web.xml file. This property sheet is also referred to as the deployment descriptor editor. These properties appear on tabbed panes:
You can modify the values in the deployment descriptor for each deployment situation. You do not have to recompile or change the code in your application. This feature is useful when you need to provide external server data. Examples might include the name of an SMTP (Simple Mail Transfer Protocol) mail server or a database server, user name and password information, or paths to locations for external resources such as HTML templates.
When you create a servlet or filter, the New wizard immediately asks for the important information and inserts the information in the deployment descriptor. You might want to update the deployment descriptor entry to specify special features, such as:
For more information about declaring servlets and filters, see Declaring the Servlet in the Deployment Descriptor and Declaring the Filter in the Deployment Descriptor. For details on updating deployment descriptor entries for servlets and filters, see "Servlets Property Editor" and "Filters Property Editor" in the JSP/Servlet online help.
Whether you need to register your tag library in the deployment descriptor depends on how it is packaged. You can use the Tag Libraries Property Editor for the deployment descriptor to view any entries for the tag libraries in the web module
If your tag library JAR file has a default TLD (that is, META-INF/taglib.tld), an entry for the tag library is made in the deployment descriptor file when the JAR file is added to the WEB-INF/lib directory.
If a tag library JAR file contains multiple TLD files, then it does not require a default TLD. The standard tag library (JSTL) is an example of this situation. In this case, an explicit tag library entry is not required in the deployment descriptor. The JSP translation extracts the URI fields from the TLD files in any JAR file in the WEB-INF/lib directory to create an implicit tag library mapping.
Not all tag libraries have a default TLD specified. You can use the Tag Libraries Property Editor to explicitly create a tag library entry in the deployment descriptor.
For example, the following taglib directive makes the TLD located at /WEB-INF/tlds/myTagLib.tld accessible through the URI myTags:
<taglib> <taglib-uri>/myTags</taglib-uri> <taglib-location>/WEB-INF/tlds/myTagLib.tld</taglib-location></taglib> |
For details, see Packaging and Deploying a Custom Tag Library
If you remove a tag library declaration, it does not automatically remove the corresponding JAR file from the WEB-INF/lib directory.
The Tag Libraries Property Editor is primarily used to indicate which tag libraries have been added. It also enables you to change the URI mappings of the tag libraries. Each entry corresponds to a taglib element in the deployment descriptor. Refer to the URI mapping at the top of your JSP file to use the specified tag library. The URI reference also ensures that custom tag library code completion works. For more information, see Using Tag Libraries.
Use the Tag Libraries Property Editor to add, edit, or remove references to the tag library JAR file from the selected web module. The addition or removal of items using this property editor does not affect the tag library JAR file in the WEB-INF/lib directory.
If you choose Add JSP Tag Library from the selected web module's contextual menu, an entry for each tag library is created in the deployment descriptor.
If you know the deployment descriptor XML syntax, you can edit the web.xml file directly by double-clicking the web.xml icon. When you save your changes, the IDE automatically parses the file. It then displays any errors in the Output window on the XML Parser tab. You can also edit the file using an external text editor.
The IDE is installed with two integrated servers, Sun ONE Application Server 7 and Tomcat. Both servers appear under the Installed Servers node in the Server Registry on the Explorer's Runtime tab. By default, the IDE uses Sun ONE Application Server 7 to compile and execute web components such as JSP pages and servlets.
You can use the IDE to perform the following actions:
For more information about the integrated servers, see the Sun ONE Application Server Integration Module help set and the Tomcat Plugin help set in the online help.
Before you can run a web module, you must first deploy it by right-clicking the WEB-INF node and choosing Deploy from the contextual menu. The IDE deploys the web module to the context that is designated by the Context Root value on the WEB-INF node's property sheet. The context root must have a leading forward slash, for example, /test. This context root is used to form the web module's document root. For example, if a web module's context root is /test, the document root might be http://host:8080/test.
When you initiate the Deploy action the IDE saves the files, recompiles any servlets, and then deploys the web module. Note that the JSP files are not compiled until they are actually loaded at run time.
Once you have deployed a web module, you can test run the module within the IDE by using the Execute action. This action executes the application from a client web browser using the specified default browser.
You can set a web module's execution properties on the Execution tab of the WEB-INF node's property sheet.
If you want to execute several web modules as a group, you must first create a web module group. For details, see Creating and Executing a Web Module Group. A web module group is an IDE-specific construct. It enables you to specify a set of web modules to deploy together on a web server with a single action. Each module in the group must have a unique context root. The context root ensures that requests are properly sent to the correct module by the web server.
As you execute web modules and web module groups, you can use the HTTP Monitor. It enables you to examine the flow of record data. See Using the HTTP Monitor to Debug a Web Application for more information.
When you deploy or execute a web module, the IDE automatically updates the server's configuration file. For more information about server configuration, see "Administration Server" in the Sun ONE Application Server Integration Module online help and "Editing the Tomcat Server Configuration File" in the Tomcat Plugin online help.
PointBase is installed with the Sun ONE Studio 5 software in the subdirectory that contains the Sun ONE Application Server 7 software. If the IDE and Sun ONE Application Server 7 were installed separately, the server may or may not include PointBase software. If it does not, you must download and install PointBase software manually. See "Using Databases With the IDE" in the Sun ONE Studio 5, Standard Edition Getting Started Guide for information about starting the PointBase Server and setting up database connectivity. The same chapter also contains information about using other JDBC enabled databases with Sun ONE Application Server 7.
If you are using Tomcat, you must do one of the following to make a database driver available to the Tomcat servlet container:
Note that adding a database driver to your system class path does not necessarily make it accessible to your web server.
You can test communications using your database driver with the Database Explorer in the IDE. This practice ensures that the driver you are using works properly with both the Java language and the IDE.
To execute a single web module, right-click the module and choose Execute from the contextual menu. The web module executes and is displayed in your selected default browser. The execute action instructs the browser to request the root of the web module. This action causes the server to attempt to serve a welcome file within the root directory. You can set the welcome files by editing the Welcome Files property in the property sheet for the web.xml file. If the server cannot find a welcome file, it simply lists the contents of the directory.
Note that if you have not yet deployed the module or if you have made changes to the module, you must first deploy the module by right-clicking the WEB-INF node and choosing Deploy from the contextual menu. This deploy action causes the IDE to take the following actions:
Note - If you are deploying to the internal Tomcat server, then you do not need to do the deploy action. The execute action both deploys and executes. |
You can use the HTTP Monitor to track the requests to the web module and the data flow inside the web application. See Using the HTTP Monitor to Debug a Web Application for more information. If problems occur, check the Output window that appears upon execution.
When a web module is executed in the server, a class path is constructed. The class path ensures that all necessary classes and libraries in the web module can be located. By default, the order of web module elements in the class path for servlet execution is:
2. Any JAR files in WEB-INF/lib
3. Other classes or libraries, depending on your server's implementation of class loading
The IDE provides a mechanism to deploy several web modules together so they can be run at the same time. You create a web module group node in the IDE and add web modules to it. Then you use the deploy and execute actions.
To create and execute a web module group, you perform four main tasks:
1. Create a web module group object by right-clicking a mounted filesystem, choosing New from the contextual menu, and choosing All Templates. In the New wizard that appears, expand JSPs & Servlets and select Web Module Group. Click Next and complete the steps in the wizard. A web module group node appears in the root directory of the mounted filesystem.
The web module group node should be placed outside a web module. This placement ensures that the web group is not inadvertently included when being packaged for deployment.
2. Set a URL mapping for each of the web modules to be loaded as part of the web module group by right-clicking on the web module group node and choosing Add Web Module from the contextual menu.
3. (Optional) Open the property sheet for the web module group node and specify a Target Server for the web module group. If no target server is specified, the default web server is used.
4. Right-click the web module group node and choose Deploy. After the IDE completes the deploy action, right-click the web module group node and choose Execute.
See "Creating a Web Module Group" in the JSP/Servlet online help for details on these tasks.
You can set a target server for an individual web module. You perform this task by editing the Target Server property for that web module. However, a component of that web module might be executed while the web module is running as part of a web module group. In this case, the web module runs within the server specified by the Target Server property for the web module group. For more information, see "Setting WEB-INF Properties" in the JSP/Servlet online help.
You might have your own installation of Sun ONE Application Server 7 or the Tomcat 4.0 web server on your system. You can set your own installation as the default web server. Alternatively, you can specify that your installed server be used for a designated web module. For more information, see the section on setting the Target Server property in "Creating a Web Module Group" in the JSP/Servlet online help.
See the Sun ONE Studio 5, Standard Edition Getting Started Guide for information about using an external Sun ONE Application Server 7. For an external Tomcat 4.0 web server, configure the IDE's Tomcat plugin module to use that instance rather than the internal server. See "Adding a Tomcat 4.0 Installation" in the Tomcat Plugin online help for details.
The integration with the Tomcat web server has two modes of operation:
The IDE provides two tools for debugging web applications:
The HTTP Monitor is a lightweight tool that can be used as an alternative or a complement to source-level debugging. It is provided by the IDE for collecting data related to the execution of JSP files and servlets in the servlet container. The data records generated by the HTTP Monitor streamline the work involved in debugging JSP files and servlets. The HTTP Monitor records information about each request that comes into the server. This data includes incoming and outgoing cookies, session information maintained on the server, the servlet environment information, and HTTP headers.
The HTTP Monitor provides a view into the data flow among web application components of the web application. You can use the monitor to examine the properties of the HTTP requests. You can also use it to inspect any data maintained on the server whenever a request is processed by a JSP page or a servlet. For example, you can find out if:
If you discover a bug while test running, use the HTTP Monitor to view data records associated with requests leading up to it. You can quickly find out if the problem was caused by a JSP page or servlet not receiving the data it expected. In this case, you can determine which resource started the problem. By using the Edit and Replay feature, you can tweak requests before resending them. This technique enables you to determine if sending different data fixes the bug. Often this knowledge is enough to identify the lines of code causing the problem. If not, you might narrow down an individual JSP page or servlet to step through with the source-level debugger. For details, see Source-Level Debugging.
Once you have fixed the bug, use the HTTP Monitor again to replay the request or requests that exposed the problem. This technique can save time if reproducing the steps involves entering data through a browser, for example.
The HTTP Monitor enables you to save recorded request data. If you find a problem you do not have time to fix immediately, save the relevant records and go through the process described above later. You can also, for example, save a sequence of requests representing an application sanity test. You can then run it every time you change something.
In summary, use the monitor to:
For details on error sources in web applications, see Common Errors in Web Applications. For details on source-level debugging, see Source-Level Debugging.
Before you can use the HTTP Monitor on a web application, you must perform the following steps to make the monitor available to the server:
1. Copy IDE-install-directory/modules/schema2beans.jar and IDE-install-directory/modules/ext/httpmonitor.jar to the web module's WEB-INF/lib directory.
1. In the Deployment tab of the property sheet, display the property sheet for the Deployment Descriptor node (WEB-INF/web.xml), click the Filters value field, click the ellipses (...) button to display the Filters dialog box, and click Add.
2. In the Add Filter dialog box, set the Filter Logical Name to HTTPMonitorFilter or a similar descriptive name.
3. In the Filter Class text field, type the following:
org.netbeans.modules.web.monitor.server.MonitorFilter
4. Click Add under the Filter Mapping table to display the Add Filter Mapping dialog box and click OK to accept the default of /*.
5. Click Add under the Init Parameters table to display the Add Init Parameter dialog box.
6. In the Init Param Name text field, type netbeans.monitor.ide.
7. In the Init Param Value text field, type the following (replace the variables with the actual values):
name-of-host-that-runs-IDE:port-of-internal-HTTP-server
If you are unsure of the port number, open the property sheet for the HTTP Server node in the Runtime tab of the Explorer window. The Port property shows the port number.
8. Click OK to dismiss the Add Init Parameter dialog box and click OK to dismiss the Add Filter dialog box.
Remember to remove the JAR files, the filter, and the filter mappings before you deploy to a production server.
The HTTP Monitor consists of a top level window within the IDE, and a server-side component that runs on the execution server. To open the HTTP Monitor, choose HTTP Monitor from either the IDE's View menu or Debug menu. For more information, see "Monitoring Data Flow on the Web Server" in the HTTP Monitor module online help.
The HTTP Monitor consists of two panels. On the left, the HTTP Monitor records panel contains a tree view of known records. On the right, the HTTP Monitor records display panel presents the data associated with the selected monitor record.
In the tree view, the All Records category contains two subcategories: Current Records and Saved Records. Individual monitor data records reside in either of these subcategories. Entries in Current Records are available only during the current IDE session. Current monitor data records persist across restarts of the web server. They are only cleared on a restart of the IDE or when deleted. Entries in Saved Records persist until deleted.
Sometimes, a data record is created as the result of one resource dispatching the request to another resource. An example of this situation is a JSP forwarding to a servlet. In this case, the record is shown as an expandable node in the tree. To see how the request was processed by any other resources activated by the forward or include actions, expand the node.
Monitor data records in all categories can be sorted according to various criteria using the buttons above the tree view. For details on sorting criteria, see "Using the HTTP Monitor Toolbar" in the HTTP Monitor online help.
For each selected monitor data record, corresponding information appears in the HTTP Monitor records display panel. The records display panel consists of these panes:
You can replay HTTP requests associated with the Current Records and Saved Records subcategories of the All records tree view. Replaying a request makes the server process a request identical to the request that was recorded. The response is shown in the IDE's default web browser, just as it is when you execute a web module.
This feature can simplify the process of testing the correction to a bug. For example, you might have found a bug and modified some code in a resource that processes form data. To verify the correction, you would usually load the form into the browser, enter data, and submit it. Using the Replay action on the original request record, you could bypass the need to reenter the data. Another example would be if you needed to step through several requests before you could reproduce a bug. The bug might be in a resource that is part of the implementation of a checkout. Moreover, users cannot enter the checkout unless they have placed something in the shopping cart. In that case, you could replay several recorded requests. This action would place the web application in a state where the bug correction could be confirmed.
See "Editing and Replaying Requests in the HTTP Monitor" in the HTTP Monitor online help for details.
The Edit and Replay dialog box enables you to edit a number of properties prior to resending the request information. These properties include the request parameters and/or the query string, the cookies, and the headers. An option is also provided to send the request to a different server, if it fully supports the HTTP Monitor.
You can use the Edit and Replay dialog box to send requests to a different server.
Use the Edit and Replay feature to:
If you replay a request, the HTTP Monitor, by default, uses the session cookie that the browser is sending, if it sends a cookie. The monitor does not use the session cookie recorded with the request. You can control this behavior so the recorded cookie, or a cookie you specify, is used instead. See "Editing and Replaying Requests in the HTTP Monitor" in HTTP Monitor online help for details.
When a JSP page is executed as part of a web application, a servlet is actually what is executed. The JSP page is translated into a servlet, called the generated servlet. The generated servlet is then compiled and run. When using Sun ONE Application Server 7 or the Tomcat server, the IDE maintains a mapping between lines in the original JSP source and lines in the generated servlet. This feature enables you to debug JSP pages from either:
Source-level debugging consists of several enhancements to the standard IDE debugging environment. These enhancements enable JSP and generated servlet files to be viewed simultaneously. Breakpoints set in one are automatically reflected in the other. However, breakpoints removed from the generated servlet are not removed from the corresponding JSP source file.
A JSP file, with all its statically included files, maps to a single servlet file. (See Using the <%@include%> Directive for details.) Specifically, one line in the JSP file maps to one or more lines in the servlet file. The servlet also contains code generated for all JSP pages, with no explicit representation in the JSP source.
To debug your application using the IDE's source-level debugging features, you set breakpoints, view the generated servlet, and start the debugger, as described in the following sections.
Setting breakpoints in a regular servlet or class file is no different from debugging other Java classes. For JSP pages, you can set breakpoints in either the JSP source file or in the generated servlet.
If you set a breakpoint in a JSP source file, it is automatically reflected in the generated servlet. (Remember that no one-to-one-line correspondence exists between the two files). If you set a breakpoint in a generated servlet, it is reflected in the JSP page with one exception. If the breakpoint is in part of the servlet derived from a statically included JSP page, it is not reflected. Removing a breakpoint from the JSP file removes the corresponding breakpoint in the generated servlet. However, the reverse is not the case.
From the Explorer, click the Filesystems tab. Select the JSP source file. Right-click to display the contextual menu. If the JSP file has not yet been compiled, that is, the View Servlet action is not enabled, choose Compile from the contextual menu. Once the JSP file has been compiled, choose View Servlet from the contextual menu.
The Source Editor opens with a view of the generated servlet code. If the JSP file is already opened in the editor, you can also view its generated servlet from the editor's contextual menu. Right-click inside the editor window, and select the Show code in servlet action.
By default, the generated servlet file appears in a new tabbed pane of the Source Editor.
Note that the generated servlet is not automatically updated if you make changes to the JSP source. After you make changes, run the View Servlet or the Show code in servlet action again to see the new version.
Start the debugger by selecting the resource you would like to debug in the Explorer. Then choose the Start item from the IDE's Debug menu. It is not necessary to stop and restart the debugger to debug a different resource. With the web module running, either follow a link in the browser window, or type the URL directly into the browser's location field.
When debugging a helper class that cannot be run on its own, you must start the debugger on a different resource, for example, on the web module's WEB-INF node.
To debug a web module group, select the WEB-INF node from any web module within the web module group. Then choose Start from the Debug menu.
For more information about standard debugging in the IDE, see "Debugging a Program" in the Core IDE online help.
When you start the debugger, the HTTP Monitor window appears. See Using the HTTP Monitor to Debug a Web Application for more information on using the HTTP Monitor to aid in debugging.
You can customize your JSP debugging sessions through the IDE's global options as follows:
For details, see "JSP Debugger Options" in the JSP/Servlet online help.
You can view the JSP source file and its generated servlet file side by side during debugging. This features helps you detect JSP errors during the debugging cycle. You can set breakpoints and step through code with both files in sync.
Open the generated servlet in the Source Editor. (See Viewing the Generated Servlet for details.) With the JSP file still selected in the Explorer, choose Open from the contextual menu. By default, the JSP source file code appears in a new tabbed pane of the Source Editor. At this point, you can see the servlet code or the JSP code, but not both at the same time. Right-click the current view in the editor, and choose Clone View from the contextual menu. This action opens a new Source Editor window with a view on the same JSP code.
Now two editor windows are displayed side by side. One window provides a view of the JSP code. Another window offers a view of the servlet code. You must compile the JSP file in order to show the changes in the generated servlet. For details, see "Viewing JSP and Servlet Files During Debugging" in the JSP/Servlet online help.
During development, a web module is typically executed in its unpacked form. This practice makes it easy to update frequently. However, when you are ready to deploy to a production environment, you can package the web module into a Web ARchive (WAR) file. This practice facilitates the transfer process. When you create a WAR file from the IDE, the IDE, by default, includes all files in the web module's filesystem except those files with the .java extension. For directions on using the IDE to package a web module directory into a WAR file, see "Packaging a Web Module" in the JSP/Servlet online help.
You can build a WAR file from a web module in one of two ways:
Then you must specify a name for the WAR file. All files under the web module filesystem are included in your WAR file by default.
For additional information, see "Packaging a Web Module" in the JSP/Servlet online help.
Packaging options for web modules appear on Archive tab of the WEB-INF node property sheet. You can add files that are external to the web module to the WAR package. Files can be added from any filesystem mounted in the Explorer. Possible choices include all files, all files except .java (the default option), and all files except .java, .jar, and .form. Alternatively, you can specify a regular expression such as .*txt or Pro.*. You can choose either the predefined filter or a regular expression, but not both the filter and the expression. Note that the regular expressions used for filters are not the same as UNIX regular expressions. For details, see "Editing Web Module Archive Properties" in the JSP/Servlet online help.
You can view the contents of a WAR package using the WAR Contents window. Files included in a WAR package are determined by properties set using the Archive tab of the WEB-INF node's property sheet.
The WAR Contents window lists the files to be included when the web module is exported as a WAR file. It also provides path and extension information for each file.
By default, the list is sorted alphabetically by path name. Sort the list alphabetically for another column by clicking the header for that column. For more information, see "Viewing the Contents of a WAR File" in the JSP/Servlet online help.
For a JSP page to reference a custom tag library, the tag library must exist within the web module containing the JSP page. When you are using a tag library within a production web module, it is a good idea to package it as a JAR file. This practice makes it easier to use your tag library in other web modules. The tag library can be added to a web module in any of the following ways:
When you use one of these methods to add a tab library JAR file to a web module, the IDE also mounts the tag library in the Filesystems pane of the Explorer.
You package a tag library into a JAR file to make it easier to deploy. To create the tag library JAR, choose Create Tag Library JAR from the tag library's contextual menu. When you create a tag library JAR, the IDE creates a file with a .jar extension. It also creates an associated jarContent file, which adds additional classes or packages to the library. The jarContent file is also referred to as the recipe file.
For information on the properties of the newly created JAR file, see "JAR Recipe Nodes in the Explorer" in the JSP/Servlet online help.
Note - Be sure that your tag handlers are generated and compiled before creating the tag library JAR file. |
You can deploy a tag library using the Tag Library Repository.
To add a tag library from the Tag Library Repository to a web module, choose Add JSP Tag Library from the WEB-INF node's contextual menu. Then choose the Find in Tag Library Repository item, which displays the Tag Library Repository Browser dialog box. Select one or more items from the list, and click the OK button. The appropriate JAR files for the selected tag libraries are added to the WEB-INF/lib directory along with any necessary entries in the deployment descriptor.
When the tag library JAR files are added to the web module, they are also mounted in the Filesystems tab of the Explorer
If a tag library JAR is in another web module or mounted filesystem in the IDE, you can use the Add JSP Tag Library > Find in Filesystem action. This action locates the JAR and copies it into the WEB-INF/lib directory of your web module. You can add a tag library JAR file from any mounted filesystem to a web module. Right-click the WEB-INF node. Choose Add JSP Tag Library, then Find in Filesystem. If necessary, the deployment descriptor is automatically updated to include an entry for the tag library. This entry is used to map the tag library to a URI for your JSP pages to use in accessing the tags
If there is a tag library JAR in another web module or mounted filesystem in the IDE, you can choose the Copy action from the contextual menu on the Explorer's WEB-INF node. Then paste the JAR file into the WEB-INF/lib directory of your web module. When copying and pasting a tag library JAR file into a web module's WEB-INF/lib directory, a taglib element in the deployment descriptor might be created. In most cases, the IDE adds the Taglib element automatically. You can verify that the correct information is present. To perform this task, follow the instructions in "Packaging and Deploying a Custom Tag Library" in the JSP/Servlet online help.
When using the IDE, you can create a J2EE application from an existing EJB module or web module. Alternatively, you can create the application from an Explorer filesystem or package node. In both cases, after instructing the IDE to create the new application, the new J2EE application's node appears in the Explorer. Then you can begin adding modules to the application.
Note - You must assemble a web module with an EJB module in order to build an enterprise (J2EE) application. |
A J2EE application is composed of EJB modules, or web modules, or both. You create J2EE applications in the IDE, either from an existing EJB module or from a filesystem in the Explorer. After creating an J2EE application, you can add web modules to it.
For details on adding a web module to a J2EE application, see "Adding an EJB or Web Module to a J2EE Application" in the J2EE Application Assembler online help.
For more information on assembling web modules into a web application, see Building J2EE Applications.
Copyright © 2003, Sun Microsystems, Inc. All rights reserved.