Skip to content

Commit fbffdb1

Browse files
committed
edits
1 parent 971439a commit fbffdb1

12 files changed

+103
-104
lines changed

learn-pr/advocates/create-java-webapp-to-app-service-linux/1-introduction.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ uid: learn.azure.build-tomcat-java-appservice.1
33
title: Introduction
44
metadata:
55
title: Introduction
6-
titleSuffix: Azure
7-
description: This is an introduction to a topic about deploying Java-based web apps.
8-
ms.date: 02/13/2025
6+
description: Introduces a training module that shows you how to deploy Java-based web apps.
7+
ms.date: 02/20/2025
98
author: KarlErickson
109
ms.author: ayangupta
1110
ms.topic: unit

learn-pr/advocates/create-java-webapp-to-app-service-linux/2-azure-app-service-explanation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ uid: learn.azure.build-tomcat-java-appservice.2
33
title: Introduction to Azure App Service
44
metadata:
55
title: Introduction to Azure App Service
6-
description: What is Azure App Service? Find out more in this module.
7-
ms.date: 02/13/2025
6+
description: Describes Azure App Service.
7+
ms.date: 02/20/2025
88
author: KarlErickson
99
ms.author: ayangupta
1010
ms.topic: unit

learn-pr/advocates/create-java-webapp-to-app-service-linux/3-exercise-create-simple-java-app.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ uid: learn.azure.build-tomcat-java-appservice.3
33
title: Exercise - Create a simple Tomcat Java web app
44
metadata:
55
title: Exercise - Create a Simple Tomcat Java Web App
6-
titleSuffix: Azure
7-
description: Create a simple Java web app and deploy it locally.
8-
ms.date: 02/13/2025
6+
description: Shows you how to create a simple Java web app and deploy it locally.
7+
ms.date: 02/20/2025
98
author: KarlErickson
109
ms.author: ayangupta
1110
ms.topic: unit

learn-pr/advocates/create-java-webapp-to-app-service-linux/4-exercise-deploy-to-app-service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ uid: learn.azure.build-tomcat-java-appservice.4
33
title: Exercise - Deploy a web app to Azure App Service
44
metadata:
55
title: Exercise - Deploy a Web App to Azure App Service
6-
description: Deploy a simple Tomcat Java web app to Azure App Service.
7-
ms.date: 02/13/2025
6+
description: Shows you how to deploy a simple Tomcat Java web app to Azure App Service.
7+
ms.date: 02/20/2025
88
author: KarlErickson
99
ms.author: ayangupta
1010
ms.topic: unit

learn-pr/advocates/create-java-webapp-to-app-service-linux/5-knowledge-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Knowledge check
44
metadata:
55
title: Knowledge Check
66
description: Check your knowledge of creating and deploying Java web apps to Azure App Service.
7-
ms.date: 02/13/2025
7+
ms.date: 02/20/2025
88
author: KarlErickson
99
ms.author: ayangupta
1010
ms.topic: unit
@@ -13,7 +13,7 @@ durationInMinutes: 5
1313
quiz:
1414
title: Check your knowledge
1515
questions:
16-
- content: What is the primary purpose of using Apache Maven in Java web application development?
16+
- content: What's the primary purpose of using Apache Maven in Java web application development?
1717
choices:
1818
- content: To provide a web server for hosting the application.
1919
isCorrect: false

learn-pr/advocates/create-java-webapp-to-app-service-linux/6-summary.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ uid: learn.azure.build-tomcat-java-appservice.6
33
title: Summary
44
metadata:
55
title: Summary
6-
titleSuffix: Azure
7-
description: This is a summary of the module and instructions for cleanup of Azure resources.
8-
ms.date: 02/13/2025
6+
description: Summarizes the module and provides instructions for the cleanup of Azure resources.
7+
ms.date: 02/20/2025
98
author: KarlErickson
109
ms.author: ayangupta
1110
ms.topic: unit

learn-pr/advocates/create-java-webapp-to-app-service-linux/includes/1-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ By the end of this module, you'll be able to do the following things:
1313
## Prerequisites
1414

1515
- Your own Azure subscription. [Create one for free.](https://azure.microsoft.com/free/).
16-
- [Azure CLI](/cli/azure/install-azure-cli?WT.mc_id=java-9121-yoterada)
16+
- [Azure CLI](/cli/azure/install-azure-cli)
1717
- [JDK 17](https://www.oracle.com/java/technologies/downloads/)
1818
- [Apache Tomcat 10.1.x](https://tomcat.apache.org/download-10.cgi)
1919
- [Maven 3.9.9](https://maven.apache.org/download.cgi?.=)

learn-pr/advocates/create-java-webapp-to-app-service-linux/includes/2-azure-app-service-explanation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Azure App Service is a fully managed platform for building, deploying, and scaling web apps. It supports multiple programming languages and frameworks and enables developers to focus on coding, while Azure manages the infrastructure and scaling automatically. Azure App Service offers built-in integration with popular development tools, continuous integration, and deployment capabilities, making it easier to create web and mobile applications with minimal setup.
44

5-
:::image type="content" source="../media/azure-app-service.png" alt-text="Screenshot that shows Azure App Service in the Azure portal screen." lightbox="../media/azure-app-service.png":::
5+
:::image type="content" source="../media/azure-app-service.png" alt-text="Screenshot of the Azure portal that shows the Azure App Service page." lightbox="../media/azure-app-service.png":::
66

77
## Key features of Azure App Service
88

9-
The following are key features of Azure App Services:
9+
Azure App Service provides the following key features:
1010

1111
- Multiple language support. Azure App Service supports a wide variety of programming languages and frameworks, including ASP.NET, Java, Python, Node.js, PHP, and Ruby. This flexibility enables developers to choose the best tools for their projects.
1212
- Built-in DevOps. Azure App Service offers seamless integration with CI/CD pipelines using GitHub, Bitbucket, Azure DevOps, and other popular services. This integration ensures continuous deployment and automated testing in your app's lifecycle.

learn-pr/advocates/create-java-webapp-to-app-service-linux/includes/3-exercise-create-simple-java-app.md

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ Web applications are widely used to handle real-world tasks such as inventory ma
22

33
Suppose you're a developer working on a project to build a dynamic web application where users can enter data and interact with your platform in real time. Your client wants this app to be available locally for testing, and on the cloud for easy access. This setup lets you test on your local machine first, and then deploys to a live environment as a seamless transition. Building this setup from scratch gives you flexibility for future updates and configurations.
44

5-
In this module, you explore the essential steps for building and deploying a Java web app with Tomcat. You have two options: either clone an existing project from Azure Samples for immediate deployment, or build a new project from scratch with Maven. This module covers setting up your Maven project, configuring Tomcat, deploying the app locally, and using tools like Maven to manage dependencies and packages.
5+
In this module, you explore the essential steps for building and deploying a Java web app with Tomcat. You have two options: either clone an existing project repo for immediate deployment, or build a new project from scratch with Maven. This module covers setting up your Maven project, configuring Tomcat, deploying the app locally, and using tools like Maven to manage dependencies and packages.
66

77
By the end of this module, you'll be able to create and deploy Java-based web applications on Tomcat, preparing you to support web application deployment both locally and in cloud-hosted environments.
88

99
## Create a Java Tomcat web app
1010

1111
In this exercise, you create a minimal Java web application that takes an input and displays the result on the screen. You then deploy the web app locally on your computer using Tomcat. You have the following two options:
1212

13-
1. Option 1: Clone the repo from Azure samples and immediately deploy your web app.
14-
2. Option 2: Create a Maven Tomcat project from scratch.
13+
- Option 1: Clone the sample repo and immediately deploy your web app.
14+
- Option 2: Create a Maven Tomcat project from scratch.
1515

16-
## Option 1: Clone the repo from Azure samples and immediately deploy your web app
16+
## Option 1: Clone the sample repo and immediately deploy your web app
1717

1818
To clone the repo, use the following steps:
1919

@@ -25,23 +25,23 @@ To clone the repo, use the following steps:
2525
1. Navigate to the cloned project repo by using the following command:
2626

2727
```bash
28-
cd simple-tomcat-app
28+
cd simple-tomcat-app
2929
```
3030

3131
Use the following steps to configure your local Tomcat server so you can deploy locally to Tomcat:
3232

3333
> [!WARNING]
34-
> Storing usernames and passwords directly in configuration files like **tomcat-users.xml** and Maven's **settings.xml** in plaintext isn't considered secure, and we generally don't recommend this practice - especially for production environments. However, as this is just a Learn module, other alternatives are outside the scope of this module. Don't use your real username and password!
34+
> Storing usernames and passwords directly in configuration files like **tomcat-users.xml** and Maven's **settings.xml** in plain text isn't considered secure, and we generally don't recommend this practice - especially for production environments. However, other alternatives are outside the scope of this training module. Don't use your real username and password!
3535

36-
1. Edit the Tomcat configuration file **conf/tomcat-users.xml** so that it is like the following code sample:
36+
1. Edit the Tomcat configuration file **conf/tomcat-users.xml** so that it looks like the following example:
3737

3838
```xml
3939
<tomcat-users>
4040
<user username="your-tomcat-username" password="your-tomcat-password" roles="manager-script"/>
4141
</tomcat-users>
4242
```
4343

44-
1. Add your credentials to the Maven **~/.m2/settings.xml** file by using the following code example, where you replace `your-tomcat-username` with a username, and `your-tomcat-password` with a password:
44+
1. Add your credentials to the Maven **~/.m2/settings.xml** file by using the following example, where you replace `your-tomcat-username` with a username, and `your-tomcat-password` with a password:
4545

4646
```xml
4747
<servers>
@@ -59,7 +59,7 @@ Use the following steps to configure your local Tomcat server so you can deploy
5959
mvn clean package cargo:deploy
6060
```
6161

62-
Success! Access your app at `http://localhost:8080/simple-tomcat-app`.
62+
After deployment, you can access your app at `http://localhost:8080/simple-tomcat-app`.
6363

6464
## Option 2: Create a Maven Tomcat project from scratch
6565

@@ -77,7 +77,7 @@ mvn archetype:generate \
7777
-DinteractiveMode=false
7878
```
7979

80-
The following is typical output:
80+
The following output is typical:
8181

8282
```output
8383
[INFO] ----------------------------------------------------------------------------
@@ -118,50 +118,50 @@ You now have a new Maven web project in a folder named **simple-tomcat-app**. Th
118118
119119
Modify the **pom.xml** file by using the following steps:
120120
121-
1. Open **pom.xml** and set the Java version to 21 by using the following code example:
121+
1. Open **pom.xml** and set the Java version to 21 by using the following example:
122122
123123
```xml
124124
<java.version>21</java.version>
125125
<maven.compiler.source>21</maven.compiler.source>
126126
<maven.compiler.target>21</maven.compiler.target>
127127
```
128128
129-
1. Add Tomcat and Azure deployment plugins by using the following code example:
129+
1. Add Tomcat and Azure deployment plugins by using the following example:
130130
131131
```xml
132-
<!-- Tomcat 10 Maven Plugin -->
133-
<plugin>
134-
<groupId>org.codehaus.cargo</groupId>
135-
<artifactId>cargo-maven3-plugin</artifactId>
136-
<version>1.9.9</version>
132+
<!-- Tomcat 10 Maven Plugin -->
133+
<plugin>
134+
<groupId>org.codehaus.cargo</groupId>
135+
<artifactId>cargo-maven3-plugin</artifactId>
136+
<version>1.9.9</version>
137+
<configuration>
138+
<!-- Container Configuration -->
139+
<container>
140+
<containerId>tomcat10x</containerId>
141+
<type>remote</type>
142+
</container>
143+
<!-- Configuration for Remote Deployment -->
137144
<configuration>
138-
<!-- Container Configuration -->
139-
<container>
140-
<containerId>tomcat10x</containerId>
141-
<type>remote</type>
142-
</container>
143-
<!-- Configuration for Remote Deployment -->
144-
<configuration>
145-
<type>runtime</type>
145+
<type>runtime</type>
146+
<properties>
147+
<cargo.remote.uri>http://localhost:8080/manager/text</cargo.remote.uri>
148+
<cargo.remote.username>cargo</cargo.remote.username>
149+
<cargo.remote.password>your-cargo-password</cargo.remote.password>
150+
</properties>
151+
</configuration>
152+
<!-- Deployable Artifact Configuration -->
153+
<deployables>
154+
<deployable>
155+
<groupId>${project.groupId}</groupId>
156+
<artifactId>${project.artifactId}</artifactId>
157+
<type>war</type>
146158
<properties>
147-
<cargo.remote.uri>http://localhost:8080/manager/text</cargo.remote.uri>
148-
<cargo.remote.username>cargo</cargo.remote.username>
149-
<cargo.remote.password>your-cargo-password</cargo.remote.password>
159+
<context>${project.artifactId}</context>
150160
</properties>
151-
</configuration>
152-
<!-- Deployable Artifact Configuration -->
153-
<deployables>
154-
<deployable>
155-
<groupId>${project.groupId}</groupId>
156-
<artifactId>${project.artifactId}</artifactId>
157-
<type>war</type>
158-
<properties>
159-
<context>${project.artifactId}</context>
160-
</properties>
161-
</deployable>
162-
</deployables>
163-
</configuration>
164-
</plugin>
161+
</deployable>
162+
</deployables>
163+
</configuration>
164+
</plugin>
165165
```
166166
167167
Here's the full content of the **pom.xml** file:
@@ -243,7 +243,7 @@ Here's the full content of the **pom.xml** file:
243243

244244
### Create a web interface
245245

246-
To add a web page, edit the **src/main/webapp/index.jsp** file by using the following code example:
246+
To add a web page, edit the **src/main/webapp/index.jsp** file by using the following example:
247247

248248
```html
249249
<!DOCTYPE html>
@@ -265,7 +265,7 @@ To add a web page, edit the **src/main/webapp/index.jsp** file by using the foll
265265

266266
### Create a servlet
267267

268-
A servlet is a Java programming class used to extend the capabilities of a server by handling requests and generating dynamic content. Servlets run on the server side within a web container - such as Apache Tomcat - and are primarily used to process HTTP requests in web applications. When a client - for example, a web browser - sends a request to a web server, the servlet processes the request. The servlet performs any necessary business logic, for example, accessing databases or calling other services, and then generates a response - often in the form of HTML - to send back to the client. Servlets enable developers to create dynamic, platform-independent web applications using Java.
268+
A servlet is a Java programming class used to extend the capabilities of a server by handling requests and generating dynamic content. Servlets run on the server side within a web container - such as Apache Tomcat - and are primarily used to process HTTP requests in web applications. When a client - for example, a web browser - sends a request to a web server, the servlet processes the request. The servlet performs any necessary business logic - for example, accessing databases or calling other services - and then generates a response - often in the form of HTML - to send back to the client. Servlets enable developers to create dynamic, platform-independent web applications using Java.
269269

270270
To create a servlet, use the following steps:
271271

@@ -278,25 +278,25 @@ To create a servlet, use the following steps:
278278
1. Update the contents of the **HelloSeverlet.java** file by using the following code example:
279279

280280
```java
281-
package com.example;
282-
283-
import jakarta.servlet.ServletException;
284-
import jakarta.servlet.annotation.WebServlet;
285-
import jakarta.servlet.http.HttpServlet;
286-
import jakarta.servlet.http.HttpServletRequest;
287-
import jakarta.servlet.http.HttpServletResponse;
288-
289-
import java.io.IOException;
290-
291-
@WebServlet("/hello")
292-
public class HelloServlet extends HttpServlet {
293-
@Override
294-
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
295-
String name = request.getParameter("name");
296-
response.setContentType("text/html");
297-
response.getWriter().write("<h1>Hello, " + name + "!</h1>");
298-
}
299-
}
281+
package com.example;
282+
283+
import jakarta.servlet.ServletException;
284+
import jakarta.servlet.annotation.WebServlet;
285+
import jakarta.servlet.http.HttpServlet;
286+
import jakarta.servlet.http.HttpServletRequest;
287+
import jakarta.servlet.http.HttpServletResponse;
288+
289+
import java.io.IOException;
290+
291+
@WebServlet("/hello")
292+
public class HelloServlet extends HttpServlet {
293+
@Override
294+
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
295+
String name = request.getParameter("name");
296+
response.setContentType("text/html");
297+
response.getWriter().write("<h1>Hello, " + name + "!</h1>");
298+
}
299+
}
300300
```
301301

302302
Your new file structure looks like this:
@@ -325,17 +325,17 @@ Your new file structure looks like this:
325325
Use the following steps to configure your local Tomcat server so you can deploy to it:
326326
327327
> [!WARNING]
328-
> Storing usernames and passwords directly in configuration files like **tomcat-users.xml** and Maven's **settings.xml** in plaintext isn't secure and isn't generally recommended, especially for production environments. However, since this is just a Learn module, other alternatives are outside the scope of this module. Don't use your real username and password!
328+
> Storing usernames and passwords directly in configuration files like **tomcat-users.xml** and Maven's **settings.xml** in plain text isn't secure and isn't generally recommended, especially for production environments. However, other alternatives are outside the scope of this training module. Don't use your real username and password!
329329
330-
1. Edit the Tomcat configuration file **conf/tomcat-users.xml** by using the following code example:
330+
1. Edit the Tomcat configuration file **conf/tomcat-users.xml** by using the following example:
331331
332332
```xml
333333
<tomcat-users>
334334
<user username="your-tomcat-username" password="your-tomcat-password" roles="manager-script"/>
335335
</tomcat-users>
336336
```
337337
338-
1. Add your credentials to Maven's **~/.m2/settings.xml** file by using the following code example, replacing `your-tomcat-username` with a username and `your-tomcat-password` with a password:
338+
1. Add your credentials to Maven's **~/.m2/settings.xml** file by using the following example, replacing `your-tomcat-username` with a username and `your-tomcat-password` with a password:
339339
340340
```xml
341341
<servers>
@@ -355,4 +355,4 @@ Use the following command to package and deploy your web app:
355355
mvn clean package cargo:deploy
356356
```
357357

358-
Success! Your app is available at `http://localhost:8080/simple-tomcat-app`.
358+
After deployment, your app is available at `http://localhost:8080/simple-tomcat-app`.

0 commit comments

Comments
 (0)