Server User Manual
Table Of Contents
- Developing Applications for J2EE™ Servers
- Contents
- Ch 1: Introduction
- Ch 2: Programming for the Java 2 Platform, Enterprise Edition
- Ch 3: Creating applications with J2EE technologies
- Ch 4: Configuring the target server settings
- Ch 5: Using JBuilder with Borland servers
- Configuring Borland servers in JBuilder
- Making the ORB available to JBuilder
- Configurations, partitions, partition services, and J2EE APIs
- Starting the configuration or server
- Remote deploying
- Remote debugging
- Web module workarounds
- Displaying the Borland Management Console in JBuilder
- International issues
- Borland servers and JDataStore 7.0
- Ch 6: Using JBuilder’s CORBA tools
- Ch 7: Using JBuilder with BEA WebLogic servers
- Ch 8: Using JBuilder with IBM WebSphere servers
- Ch 9: Using JBuilder with JBoss servers
- Ch 10: Using JBuilder with Tomcat
- Ch 11: Editing J2EE deployment descriptors
- Ch 12: Integrating with Enterprise Information Systems
- Ch 13: Building J2EE modules
- J2EE modules
- Setting module build properties
- Adding custom file types
- Sample build scenarios
- EJB JAR without any bean classes
- EJB JAR with custom files
- EJB JAR without EJB designer XML descriptors
- WAR with custom descriptor(s) in the WEB-INF directory
- WAR without any classes
- WAR with custom class filters
- WAR with custom file types
- EAR with custom files
- RAR with classes and dependencies
- Application client module with classes and dependencies
- Improving module build performance
- Index
![](/manual/borland-software/jbuilder-2005/server-user-manual/images/img-93.png)
96 Developing Applications for J2EE Servers
Running your servlet or JSP with Tomcat
Running your servlet or JSP with Tomcat
Before you run your web application, you should configure web view options to control
how Tomcat is launched in the IDE. For more information, see “Configuring the IDE for
web run/debug” in the “Working with web applications in the JBuilder IDE” chapter of
Developing Web Applications.
Before you web run your servlet or JSP in JBuilder, you also need to create a runtime
configuration, set runtime properties for your project, and compile your servlet or JSP.
For complete information about these topics, see “Working with web applications in the
JBuilder IDE” in Developing Web Applications. Once you’ve completed these tasks,
you are ready to run your servlet or JSP.
To web run your servlet or JSP in JBuilder, right-click the servlet or JSP file in the
project pane and choose Web Run. The Web Run command runs your configuration in
Tomcat without debugging it. If your servlet runs from an HTML or SHTML file, right-
click that file and choose Web Run.
If the Web Run or Web Debug command is grayed out on the context menu for a
servlet or JSP, check the runtime configuration. To run a web application, you need to
create a runtime configuration with the server type selected as the current runner. That
server must support the JSP/Servlet service. To create a runtime configuration, see
“Creating a runtime configuration” in the “Working with web applications in the JBuilder
IDE” chapter of Developing Web Applications.
Note Applets cannot be web run or web debugged. This is because applets don’t have a
URL or a web context to run in. Additionally, applets run in a client browser as opposed
to a server. Typically, you run an applet in Sun’s AppletViewer or in JBuilder’s
AppletTestbed. For more information, see “JBuilder’s AppletTestbed and Sun’s
appletviewer” in the “Working with applets” chapter of Developing Web Applications.
Starting Tomcat
When you choose Web Run, JBuilder starts Tomcat, using:
■
The runtime configuration
■
The options set on Tools|Preferences|Web Run|Debug|Optimize
Messages are logged to the web server tab displayed in the message pane. HTTP
commands and parameter values are also echoed to this pane. The name of the tab
will reflect the name of the web server, for example “Tomcat” for the Tomcat web
server.
Stopping Tomcat
To stop Tomcat, click the Reset Program button on the web server tab. To start the
web server again and re-run your web application, click the Restart Program button
on the tab. You’ll usually follow these steps when you make changes to source code,
re-compile, and re-run. You don’t need to close the web server pane each time you
start the web server.
Note The first time you press the Reset Program button, it simply sends a command to the
server to shutdown. In particular, if you are trying to debug your web application’s
lifecycle event handlers, this would call the
Servlet.destroy() and
ServletContextListener.contextDestroyed() methods. If you’re not debugging, the
server will usually shutdown by itself in a few seconds. If you press the Reset Button a
second time, the server process is terminated immediately.