Tomcat Source

Posted onby admin

Welcome to the Apache Tomcat ® 10.x software download page. This page provides download links for obtaining the latest version of Tomcat 10.0.x software, as well as links to the archives of older releases. Apache Tomcat is open source web server software for Java programming that is developed and maintains by the Apache software foundation. The initial idea of Apache tomcat software was to host and deploy the Java servlet that is the server-side Java code that manages HTTP results from client application build using Java. First, you will need to install a local Tomcat server. It sounds like you may have already done this. Next, on the toolbar at the top of IntelliJ, click the down arrow just to the left of the Run and Debug icons. There will be an option to Edit Configurations. In the resulting popup, click the Add icon, then click Tomcat and Local.

In this article, we are going to learn how to configure the Tomcat server to run a simple “Hello World” application on the web browser with JSP and Servlet (i.e Hello World with the web edition 🙂 ).

This whole process might seem confusing and complicated at first. There are a lot of new terms and tools to learn, and that can be daunting. But I promise that if you stick with it and follow along step by step it will get easier and you will know enough to configure Tomcat to run most web applications.

First, there are 3 prerequisites that you need in your computer first before we’re moving on:

IntelliJ IDEA Ultimate is required for run enterprise application such as a web application run on Tomcat. You will also need to install the Tomcat server before we proceed any further, in this tutorial I use Tomcat server version 8, but of course, you can choose a different version if you want. Last but not least, the Java EE specification is also a requisite to run our application.

What is Tomcat Server?

Tomcat Source

You can live blissfully without going through this session and still can configure the Tomcat server. However, if you have no idea about what is Tomcat, then it’s essential for us to find out what is Tomcat and why we need them.

Apache Tomcat is an open-source Servlet container that implements several enterprise specifications such as Servlet, JSP, Expression Language, and WebSocket APIs. It’s also can be called a web server or a web container. Tomcat itself is a sophisticated and complicated piece of software that is composed of many components, however, at its core, there is a component named Catalina which acts as a Servlet container. It provides you the actual implementation for Tomcat’s servlet specification, when you start running Tomcat, you’re usually run start Catalina.

Apache Tomcat doesn’t limit itself just as a Servlet container, it also contains an engine called Coyote, which is a web server. Thanks to Coyote, you can run Tomcat other of Java enterprise specifications. However, in the scope of this article, we are only interested in working with Servlet.

Let’s get started

Open Intellij IDEA => Choose Create New Project => Choose Java Enterprise on the side bar:

For Project SDK, you can choose a different version you have if you want, but you should choose java version 8 because newer versions such as Java 14, or Java 15 you might run into some problems. For the Java EE version, choose the newest version Java EE 8. For the Application Server, choose the Tomcat version you just installed by clicking on New, a new dialog will appear to let you choose the Tomcat location and click OK:

Then, on the Additional Libraries and Framework tab as on the first screen, scroll down and find Web Application and check it. Next, tick on Create web.xml. Finally, click Next.

A new window shows up, in this window, you simply provide your project name and its location, you can leave everything else as it is and click Finish:

As the project window appears, on the top corner, click on “Add Configuration” (or Edit Configuration if the Tomcat configuration is already there):

On Run/Configuration window, on the Templates tab, scroll down and click to the Tomcat Server and choose Local:

For the Application Server, you choose the correct Tomcat server’s location. For JRE, again, you can choose a different version than what you’re seeing on the screen. You also need to choose a browser to when your application starts, here I chose Chrome. Next, click to the Deployment Tab:

This is an important step to make our application later runnable. Click on the “+” sign as shown on the screen, choose Artifact:

Now for the deployment at the server startup, you can see an artifact to be deployed, for the Application context, it’s the URL in which your application will run on the browser, you can leave it or choose a more concise name:

On the Log tab, check Tomcat Locahost Log and Tomcat Catalina Log:

Now moving back to the Server tab, once you the artifact, you can see the URL now is on the http://locahost:8080/<your-application-context>, for me, it’s demoservlet. The locahost is the default name describing a local computer address, on this address, there are many different ports, and each port might have different functions such as port 80 is for an HTTP request, or port 25 is for SMTP, and so on. In this case, you can choose the port 80 as it’s port for HTTP requests. However, in case you have a web server running on port 80 and have another web server handling HTTP requests, then using port 8080 as an alternative option is a good practice.

On ‘Update’ action and On frame deactivation, you choose Update resources:

If you’re experimenting this warning, then click on this:

Finally, click “Apply” and “OK“:

For now, you should see the Tomcat icon on the top corner and your web application is ready to start, in the starter “index.jsp” file, you can edit its content as an HTML file if you wish, and click on “Run Tomcat“:

Once you press the Run button, wait a bit for Tomcat server to start, and then you should see this text on the web broswer:

But wait, I thought you were introducing Servlet, but why it’s JSP? JSP is a technology that goes along with Servlet to create dynamic web content, on the JSP file, you can write HTML, embedded Java code, and also expression language. In essence, JSPs are Servlets, through the JSP life cycle, JSP files are always translated to Servlet first. And then this Servlet file will then be compiled.

You can also view log the Server log, and Tomcat Catalina log by clicking to Services:

Tomcat source code analysis

If you want to go further, instead of editing the aforementioned JSP file, let’s create a Servlet. On src, create a new package called it servlet:

Under the package we’ve just created, right-click on this, choose New =>Create New Servlet:

A new window pops up, you can choose the name for your servlet, and its location. Uncheck “Create Java EE 6 annotated class”, click on OK:

Next, we configure the WEB-INF/web.xml file, here servlet-name is self-explanatory, servlet-class defined the type of the servlet, inside the servlet-mapping tag, we define the url-pattern in which this servlet will be available:

Now, navigate to your HelloWorld servlet, in the doGet() method, write the following code and click to Run Tomcat:

When your browser opened, go to this URL to see your servlet response: http://localhost:8080/<your-application-context>/hello. My application context is demoservlet, hence I enter http://localhost:8080/demoservlet/hello to see my servlet responses:

Conclusion

I hope you have properly set up and run the Tomcat server on IntelliJ IDEA, and if you have any troubles while configuring, don’t hesitate to leave your question in the comment session. And if you think what I am sketching is useful, don’t forget to subscribe to get weekly updates from my blog. Once again, happy coding!

Content

Apache Tomcat

The Apache Tomcat® software is an open source implementationof theJakarta Servlet,Jakarta Server Pages,Jakarta Expression Language,Jakarta WebSocket,Jakarta Annotations andJakarta Authenticationspecifications. These specifications are part of theJakarta EE platform.

The Jakarta EE platform is the evolution of the Java EE platform. Tomcat 10and later implement specifications developed as part of Jakarta EE. Tomcat 9 andearlier implement specifications developed as part of Java EE.

The Apache Tomcat software is developed in an open and participatoryenvironment and released under theApache License version 2. TheApache Tomcat project is intended to be a collaboration of the best-of-breeddevelopers from around the world. We invite you to participate in this opendevelopment project. To learn more about getting involved,click here.

Apache Tomcat software powers numerous large-scale, mission-critical webapplications across a diverse range of industries and organizations. Some ofthese users and their stories are listed on thePoweredBywiki page.

Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcatproject logo are trademarks of the Apache Software Foundation.

2021-04-26 Tomcat 7.0.109 Released

The Apache Tomcat Project is proud to announce the release of version 7.0.109 ofApache Tomcat. This release implements specifications that are part of the JavaEE 6 platform. This release contains a number of bug fixes and improvementscompared to version 7.0.108.

Full details of these changes, and all the other changes, are available in theTomcat 7 changelog.

Note: Apache Tomcat 7.0.x has reached end of life.Read more...

2021-04-06 Tomcat 10.0.5 Released

The Apache Tomcat Project is proud to announce the release of version 10.0.5of Apache Tomcat. This release implements specifications that are part of theJakarta EE 9 platform.

Applications that run on Tomcat 9 and earlier will not run on Tomcat 10without changes. Java EE based applications designed for Tomcat 9 and earliermay be placed in the $CATALINA_BASE/webapps-javaee directory andTomcat will automatically convert them to Jakarta EE and copy them to thewebapps directory. This conversion is performed using theApache Tomcatmigration tool for Jakarta EE tool which is also available as a separatedownload for off-line use.

The notable changes in this release are:

  • Fix a regression in 10.0.4 that meant that an error during an asynchronous read broke all future asynchronous reads associated with the same request instance.
  • Prevent concurrent calls to ServletInputStream.isReady() corrupting the input buffer.
  • Update the packaged version of Tomcat Native to 1.2.27 to pick up binaries built with OpenSSL 1.1.1k.

Full details of these changes, and all the other changes, are available in theTomcat 10changelog.

2021-04-06 Tomcat 9.0.45 Released

The Apache Tomcat Project is proud to announce the release of version 9.0.45of Apache Tomcat. This release implements specifications that are part of theJava EE 8 platform. The notable changes compared to 9.0.44 include:

  • Fix a regression in 9.0.44 that meant that an error during an asynchronous read broke all future asynchronous reads associated with the same request instance.
  • Prevent concurrent calls to ServletInputStream.isReady() corrupting the input buffer.
  • Update the packaged version of Tomcat Native to 1.2.27 to pick up binaries built with OpenSSL 1.1.1k.

Full details of these changes, and all the other changes, are available in theTomcat 9changelog.

Tomcat Source Code

2020-04-06 Tomcat 8.5.65 Released

Tomcat Source Not Found

The Apache Tomcat Project is proud to announce the release of version 8.5.65of Apache Tomcat. This release implements specifications that are part of theJava EE 7 platform. The notable changes compared to 8.5.64 include:

  • Fix a regression in 8.5.64 that meant that an error during an asynchronous read broke all future asynchronous reads associated with the same request instance.
  • Prevent concurrent calls to ServletInputStream.isReady() corrupting the input buffer.
  • Update the packaged version of Tomcat Native to 1.2.27 to pick up binaries built with OpenSSL 1.1.1k.

Full details of these changes, and all the other changes, are available in theTomcat 8.5changelog.

Tomcat Source

2021-04-06 Tomcat Native 1.2.28 Released

The Apache Tomcat Project is proud to announce the release of version 1.2.28 ofTomcat Native. The notable changes since 1.2.27 include:

  • Correct a regression in the fix for 65181 that prevented an error message from being displayed if an invalid key file was provided and no OpenSSL Engine was configured.

Download ChangeLog for 1.2.28

2021-02-18 Tomcat Migration Tool for Jakarta EE 0.2.0 Released

The Apache Tomcat Project is proud to announce the release of 0.2.0 of theApache Tomcat Migration Tool for Jakarta EE. This release contains a number ofbug fixes and improvements compared to version 0.1.0.

The notable changes in this release are:

Tomcat source code eclipse
  • Various fixes to the packages that are and are not converted
  • A new option to process zip archives in memory to support zip files that use options that are incompatible with a streaming approach
  • A new option to exclude files from transformation

Full details of these changes, and all the other changes, are available in thechangelog.

2020-03-06 Tomcat Connectors 1.2.48 Released

The Apache Tomcat Project is proud to announce the release of version 1.2.48 ofApache Tomcat Connectors.This version fixes a number of bugs found in previous releases.

Download ChangeLog for 1.2.48

2015-03-17 Apache Standard Taglib 1.2.5 Released

The Apache Tomcat Project is proud to announce the release of version 1.2.5 ofthe Standard Taglib. This tag library provides Apache's implementation of the JSTL 1.2 specification.

Version 1.2.5 is a minor bug fix release reverting a change made in 1.2.1 where<c:import> modified the HTTP method during POST operations, and fixing anissues that resulted in an AccessControlException during startup unlesspermission was granted to read the accessExternalEntity property.

Please see the Taglibs section for more details.

Download Changes

2013-11-11 Tomcat Maven Plugin 2.2 Released

The Apache Tomcat team is pleased to announce the release of Tomcat Maven Plugin 2.2.Changelog available here.

The Apache Tomcat Maven Plugin provides goalsto manipulate WAR projects within the Apache Tomcat servlet container.

The binaries are available from Maven repositories. You should specify theversion in your project's plugin configuration:

Tomcat source install

Apache Tomcat Source Download

or

Tomcat Source Download

Old news