Tomcat « J2EE Enterprise « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » J2EE Enterprise » Tomcat 

1. Boost Tomcat performance for static content    javaworld.com

The standard Apache-Tomcat proxy configuration places an Apache (proxy) HTTP server before the Tomcat application servers in a "neutral zone" between the company's private network and the Internet (or some other outside public network) for secure access to the company's private data. This proxy server also acts as a load balancer and as a server of static content. Figure 1 shows such a configuration scenario.

2. High availability Tomcat    javaworld.com

Edit the server.xml file (/usr/local/tomcat1/conf/server.xml or /usr/local/tomcat2/conf/server.xml) on each Tomcat by changing the non-SSL (Secure Socket Layer) Coyote HTTP/1.1 Connector element for the first server to:

3. Remotely monitor Tomcat clusters using MC4J    javaworld.com

In this article, I discuss how to install and configure MC4J to remotely connect to a Tomcat servlet container and monitor all the MBean components in a server cluster.

4. Is Tomcat enterprise ready?    javaworld.com

When Java developers start talking about application servers, Tomcat is often thrown into the mix. After all, it's one of the most popular options for lightweight development scenarios, and in many cases meets the need for an application server, even though it is technically a Web server. In this article Jeff Hanson engages the question of whether Tomcat is an app server, first by explaining what differentiates application servers, Web servers, and Java EE containers, and then by evaluating Tomcat's suitability to a variety of common Java enterprise development scenarios.

5. SpringSource announces Enterprise Tomcat    javaworld.com

SpringSource, maker of the popular open-source Spring framework for Java, on Tuesday will reveal an enterprise-class Web application server based on the open-source Apache Tomcat server, the company said.

6. Using Hierarchical Data Sets with Aspire and Tomcat    onjava.com

Although the primary focus of the article is the Java programming API for Java programmers, Hierarchical Data Sets can be used by non-Java programmers quite effectively to obtain XML, HTML, or Excel formats directly from relational databases and other data sources by using a J2EE server such as Tomcat. Without further ado, let us investigate the structure of Hierarchical Data Sets and see how these data sets can be obtained declaratively (while relaxing your programming muscles a bit).

7. OpenEJB: EJB for Tomcat    onjava.com

OpenEJB allows you to use EJBs in your applications with very few configuration files and commands. After reading this article, you will be able to use EJB as you might have been using JDBC with databases like HSQL or Cloudscape. You won't have to spend a lot of your precious time to configure and run an application server. Merely deploy a simple web application from OpenEJB distribution and map the beans deployed in OpenEJB to their respective names in Tomcat's naming system.

8. Improve Your Career with Tomcat and Aspire    onjava.com

Tomcat, the first of the two suggested products, is an open source implementation of the servlet standard (a part of J2EE) in a very small accessible package (four to five megabytes). The second product is a declarative data access tool called Aspire that allows your relational developers to write business logic in stored procedures while using such front-end tools as Dreamweaver and FrontPage. Aspire provides the declarative middle tier that ties predesigned Web pages to SQL and stored procedures. Using these two products, relational developers will be able to write comprehensive interactive Web sites that can also include charts, graphs, reports, XML, etc.

9. Using SOAP with Tomcat    onjava.com

The Apache implementation of SOAP provides two methods for invoking SOAP services: a Remote Procedure Call (RPC) model and a message-based model. The RPC method, which is the focus of this article, is a synchronous technique using a client-server model to execute remote SOAP services. The message-based model uses SMTP to transport SOAP documents to and from the appropriate SOAP server. While this method is interesting, it is out of the scope of this article.

10. Database Connection Pooling with Tomcat    onjava.com

Connection pooling eliminates JDBC overhead. Further, object pooling also helps to reduce the garbage collection load. In this article, we'll look at an elegant way of creating a pool of open database-connection objects in Tomcat, so that they are handy whenever an application needs to access a DB resource.

11. Deploying Web Applications to Tomcat    onjava.com

In this article we are going to cover the deployment of web applications using Tomcat. We are performing a manual deployment to fully explain the steps involved when deploying a web application.

12. How to Publish Multiple Websites Using a Single Tomcat Web Application    onjava.com

Knowledge Folders is a web application that holds and displays content for multiple users. I had been wondering if I could expose the content from this single web application as multiple websites with their own domain names. Could I use virtual hosts to do this? Or would I need to use reverse proxies? How and where would I register domain names? What entries would I need to make in Tomcat configuration files? How would I handle emails for these independent domains? What else would I need to do in my web application? What would the end result look like?

13. Session Replication in Tomcat 5 Clusters, Part 1    onjava.com

The Tomcat 5 server provides built-in support for clustering and session replication. This first article in this series will provide an overview of session persistence and the inner works of session replication in Tomcat clusters. I will discuss how the session replication process works in Tomcat 5 and the replication mechanisms available for session persistence across the cluster nodes. In part two, I will discuss the details of a sample Tomcat cluster setup with session replication enabled, and compare different replication scenarios.

14. Configuring Tomcat with IIS Web Server    onjava.com

Now that IIS is installed, it is time to begin the actual integration between IIS and Tomcat. This process can be broken down into two sections: configuring Tomcat, and configuring IIS. The result of our integration will make the Tomcat examples Web application available through IIS.

15. Clustering with Tomcat    onjava.com

This article describes how Web applications can benefit from clustering and presents a clustering solution that we developed for the Jakarta Tomcat Servlet Engine to provide high scalability, load-balancing, and high availability using JavaSpaces technology.

16. Using Tomcat 4 Security Realms    onjava.com

A security realm is a mechanism used for protecting Web application resources. It gives you the ability to protect a resource with a defined security constraint and then define the user roles that can access the protected resource. Tomcat has this type of realm functionality built in. The component that provides this functionality is the org.apache.catalina.Realm interface. It provides a mechanism by which a collection of usernames, passwords, and their associated roles can be integrated into Tomcat. If you download the Tomcat source, you will find this interface in the following location:

17. For Tomcat Developers, Aspire Comes in a JAR    onjava.com

Aspire.jar is a free, open source, .jar file that can be used for declarative data access, configuration, logging, and factory services needs. For Java developers who are continuing to adopt Tomcat as their primary development platform, this .jar file could save lot of time, while providing a highly flexible data architecture. Aspire.jar is only about 500K and unintrusive in your applications. Installation is as simple as downloading and including the .jar file in the appropriate classpath. You can start putting the .jar file to good use as soon as you finish this article.

18. Creating a Web Application with Ant and Tomcat 4    onjava.com

The Web application can be served on a dedicated Web server or on a personal computer running a Windows, Linux, or Mac OS X operating system. It requires a Java runtime environment (JDK 1.2 or newer), a recent version of the Tomcat Servlet/JSP Container (version 4 or better), and the Ant development tool (version 1.4 or later). Ant is used to create the Web application's Web Archive (WAR) file, and to install and deploy the WAR file into Tomcat, configuring the javax.sql.DataSource relational database interface in the process. All of these packages are available on the Internet at no cost.

19. Monitoring Applications with Palm OS & Tomcat    onjava.com

I'll begin by talking about our choice of the Palm Operating System as our client platform, and introduce you to Palm Query Applications. After that, we'll move across the network to the server side, to look at the Java that needs to run on the application server to support the wireless monitoring and management of mission-critical systems. I'll show you how to install and configure Tomcat. Then we'll finish up with an example of how to use a wireless handheld to remotely start an Oracle "listener," a vital part of most mission-critical database applications.

20. Configuring Tomcat and Apache With JK 1.2    onjava.com

To begin our Tomcat and Apache integration, we need to first tell Tomcat that it should start listening for AJP13 requests; both JK and JK2 use AJP13 to communicate with Tomcat. To do this, we need to add an additional element to Tomcat's server.xml file. Add the following entry to server.xml, making sure that it is inside of the element and immediately follows any previously-defined elements.

21. Installing and Configuring Tomcat    onjava.com

In this article we will be installing Tomcat as a stand-alone server. This means that Tomcat will service all requests, including static content, JSPs, and servlets.

22. Demystifying Tomcat 4's server.xml File    onjava.com

The Tomcat server.xml file allows you to configure Tomcat using a simple XML descriptor. This XML file is at the heart of Tomcat. In this article, I will focus on the configuration of all of the major Tomcat components found in the server.xml file. To examine these components, open your server.xml file, which can be found in the conf/ directory of your Tomcat installation. The following listing contains a simplified version of the default server.xml file.

23. Clustering and Load Balancing in Tomcat 5, Part 1    onjava.com

The latest version of the Tomcat servlet container provides clustering and load balancing capabilities that are essential for deploying scalable and robust web applications. The first part of this article provides an overview of installation, configuration, usage, and extension of clustering and load balancing features. The second will introduce a sample web application to demonstrate the steps involved in configuring Tomcat server instances to enable clustering, and will study session persistence using in-memory replication in the cluster environment.

24. Embedding Tomcat Into Java Applications    onjava.com

In this article, we'll extend our Tomcat discussions to the application level by creating a Java application that manages an embedded version of the Tomcat JSP/servlet container. Tomcat can be broken down into a set of containers, each with their own purpose. These containers are by default configured using the server.xml file. When embedding, you will not be using this file; therefore, you will need to assemble instances of these containers programmatically. The following XML code snippet contains the hierarchy of the Tomcat containers:

25. Clustering and Load Balancing in Tomcat 5, Part 2    onjava.com

This is the second part of a series on clustering and load balancing in Tomcat 5 server. In part 1, I provided an overview of large-scale J2EE system design as well as various factors to be considered when designing the system for scalability and high availability. I also discussed Tomcat's support for clustering, load-balancing, fault-tolerance, and session-replication capabilities. In this part, we'll cover the architecture of a proposed cluster setup and go over the installation and configuration details in deploying the cluster (by running multiple Tomcat server instances).

26. What's New in Tomcat 5    onjava.com

The release of Tomcat 5 corresponds with the final release of the Servlet 2.4 and JSP 2.0 specifications, so now let's take a brief look at what's new in each spec, and what impact, if any, there will be on Tomcat 5 development.

27. In Memory Session Replication In Tomcat 4    theserverside.com

I've built a simple in memory session replication plugin for the latest build of the Tomcat 4 servlet engine, a.k.a. Catalina. In order for me to go through how session replication is actually achieved I will first set you up with a running example.

28. Hibernate 3.1 Used with Tomcat 5.5.x    theserverside.com

Why would we never use this alternative syntax with Tomcat? The difference between openSession() and getCurrentSession() is that the former, each time it is used, provides a brand new Hibernate Session. That is exactly what we want in our servlet. In contrast, getCurrentSession attempts to associate a Hibernate Session with a specific thread (the Singleton-per-Thread pattern), which Hibernate achieves via the use of an embedded (hidden) ThreadLocal. Unfortunately, Tomcat maintains a thread pool, and re-uses a given thread after a particular Http request is finished with it. Hence a brand new Http request can receive a previously used thread, which already happens to have a Hibernate Session associated with it (via the ThreadLocal), and getCurrentSession() may by chance receive an unrelated Hibernate Session when it ought to receive a brand new one. We may have a new Http session, and logically a new thread, but physically be re-using an existing thread. In this way, Tomcat 5.5.x and Hibernate 3.1 can confuse each other.

29. Distribute, Detach, and Parallelize in Tomcat    today.java.net

To aim to parallelize processing is to do more work in less time. For this, we need to reduce resource contention and associated resource locking. This is especially true in situations where we need to access shared resources from multiple threads, like a database table row or a global read-write variable. In our architecture, multiple Tomcat threads collect ImpressionEvents and ClickEvents. Every time we need to regenerate ad links, we need to consider the total impressions and clicks for a particular link. This means that every Tomcat thread in each request-response cycle has to first aggregate the events based on a particular link and, based on the new figures, recalculate the weight factor for each ad link. This means every Tomcat request thread has to synchronize for doing the aggregation. But synchronization will kill one of our intentions behind parallelization. We are now at a point where we need to make some design decisions based on trade-offs.

30. How Tomcat Works excerpt    today.java.net

Budi Kurniawan, a popular author or articles that have appeared on java.net, ONJava.com, and elsewhere, has self-published his book, How Tomcat Works. He has given us permission to provide you with two chapters.

31. Tomcat and OpenLDAP, from Configuration to Application    today.java.net

To complete the OpenLDAP configuration for Tomcat, the application's web.xml file must be updated. The application available for download consists of six JSP pages, three of which are protected for the various roles set up in the LDAP directory. The application must be configured to allow form-based authentication and the application must be told what roles exist. First, create a login.jsp file. When using form-based authentication, this JSP must contain the following.

32. Real-Time Tracking and Tuning for Busy Tomcat Servers    devx.com

While trying to determine those crucial parameters and ratios, I developed an approach that helped us not only track and understand the most appropriate server capacity-related settings but also open the door to other similar real-time tracking and monitoring approaches. This article reviews the merits of my proposed technique and discusses the exact steps for implementing something similar in your applications.

33. Set the Logging Level Over a Tomcat Cluster Dynamically    devx.com

The first two lines of the doGet method look up the MBeanServer. Log4J registers the root logger with the name log4j:logger=root. This MBean provides a property to set the logging level of the root logger. You set the priority of the root logger by passing the ObjectName of the MBean to operate on, along with an instance of javax.management.Attribute to the MBean Server. In this case, you want to set the "priority" attribute. The value will be the new logging level you have specified.

34. Generate dynamic content with Tomcat and MySQL    ibm.com

Of course, ASPs such as doubleclick.net cost money. If you're like us, you don't like spending money when you could get the service for free. Wait a second -- you've probably heard that nothing in this world is free. But don't worry. All this article will cost you is your time. In fact, we'll show you how to tie together an open source (that is, free) environment to set up your own, powerful Web banner tracking system. To pull off this task, our weapons of choice will be Tomcat, MySQL, a single Java servlet, and a few helper classes. Excited? Well then, let's jump into the software installation.

35. Configuring and troubleshooting Tomcat 3.2.4 on IBM System i5/OS    ibm.com

Ease of integration and simplified installation and configuration are the key characteristics of IBM System i5 products that help customers easily implement on demand business solutions. Apache Software Foundation (ASF) Jakarta Tomcat 3.2.4 (so named because it is a product of the ASF Jakarta Project) is an open source application server, providing run time support for servlets and Java?Server Pages (JSP) technology. It is much easier to configure, deploy, and run Web applications on Tomcat than on most commercially available application servers. More important, Tomcat consumes far less RAM and processor overhead than commercial servers, enabling it to run as a light-weight application server on low-end iSeries?.

36. Filtering tricks for your Tomcat    ibm.com

Filtering is a new feature of Tomcat 4. (For a brief history of Tomcat, see The Tomcat story). It is part of the Servlet 2.3 specification and will eventually be implemented by all J2EE container vendors supporting the standard. Developers will be able to use filters to implement features that used to be awkward or difficult to achieve, including:

37. Integrate Cloudscape Version 10 or Derby with Tomcat    ibm.com

Note: This is the second version of this article. The materials and techniques provided have been enhanced to be compatible with Cloudscape Version 10 and Derby. If you are using Cloudscape Version 5, see Integrating Cloudscape and Tomcat.

38. The Tomcat story    ibm.com

In 1999 Sun donated the source code of the servlet and JSP reference engine implementations to the Apache Software Foundation (ASF). A collaborative subgroup called the Jakarta project was formed to focus on the servlet and JSP engines and merging the Sun reference implementation technology and the Apache JServ technology. But the project ended up handling all of the projects formerly under the auspices of the Apache Java group. All of the projects under the Jakarta umbrella are Java language open-source projects supporting the Apache Software License. Tomcat is one of those projects.

39. Integrating Cloudscape and Tomcat    ibm.com

There is more than one way to integrate Cloudscape with Tomcat. To illustrate the most useful alternatives, I have collected them into three sample scenarios:

40. Unleash the power of Tomcat within Geronimo    ibm.com

Apache Jakarta Tomcat has long been the reference container implementation for the latest servlets and JSP specifications. Throughout its illustrious open-source tenure, it has also been adopted by users worldwide as a production-grade, Web-tier engine, working in conjunction with industry-standard Web servers, such as the Apache Web server or the Microsoft® IIS. The great news is that the latest version of the Tomcat 5 engine is bundled standard with Geronimo, ready for activation.

41. Taming your Tomcat: Filtering tricks for Tomcat 5    ibm.com

The enhanced filtering capability in Tomcat 5 provides new deployment opportunities when using popular application frameworks. Frameworks such as Struts and Turbine (see Resources) use a JSP Model 2 architecture to separate data operations (the Model in an MVC pattern) from the business logic operations, and the presentation operations (the View). Their functionality centers around the use of a switching servlet (the Controller servlet) that forwards incoming requests to different user-created Action components, either according to a static XML directive file or using runtime introspection. These requests are typically further forwarded between components, until the response is complete. The Model 2 architecture enables designers to componentize their server-side coding for adaptability to change and easier long-term maintenance.

42. Databases and Tomcat    developer.com

The recommended approach for accessing databases from Tomcat is to use the Database Connection Pool (DBCP) connection broker incorporated into Tomcat. DBCP is part of the Jakarta commons subproject that can be found at http://jakarta.apache.org/commons. DBCP has many advantages for Web application developers:

43. Integrating/Improving Performances of Tomcat and IIS on Windows Server    developer.com

IIS is Microsoft's Internet Information Server running on the Windows Servers family. Tomcat is a worldwide-used Web server built on the Java platform for JSP/Servlets. Due to the ease of operating and maintaining IIS in a Windows environment, we still prefer to buy the Windows server and run IIS for web sites and, by default, we run Tomcat on port 8080 as the default installation.

44. Critical Steps to Secure Tomcat on Windows NT/2K/XP    developer.com

These two things allow Java Run Time to access any files in any directory of any Windows machine. By default, Java Run Time takes the security privileges according to the user that is running the Java Run Time. When Tomcat is run by an administrator or as a System Service, Java Run Time gets all the rights that the System User has or Administrator has. In that manner, Java Run Time gets the complete rights to all files in all directories. And, Servlets (JSP converted to Servlets) gets the same previlleges. So, the Java code can call File API in Java SDK to list all files in the directory, delete any file, and also the greatest risk is to RUN a program with system provileges. When any Servlet has code like this:

45. Server-Side Development on Mac OS X: Servlets and Tomcat    developer.com

In this series, we will look at how to use Mac OS X as a killer server-side development environment, or even as a deployment environment, for those who are so inclined. We'll start by helping you to set up Tomcat, and from there we'll go on to cover other server-side technologies and how they integrate with OS X.

46. Server-Side Development on Mac OS X: Launching Tomcat    developer.com

One other set of files I should touch on reside in the Resources directory, the Localizable.strings files. These are optional localization files, living inside of directories named for the language they support, (e.g., German.lproj) that contain replacement strings to use in messages. They're not necessary to make your startup script work, so we'll leave them out of the discussion. (These are covered in my upcoming book, Java Development and Mac OS X.)

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.