GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — From web.xml -> @WebServlet (#675) · tuandbe/java-docs-samples@8ebf743

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • appengine-java8
    • images
      • pom.xml
      • src/main
        • java/com/example/appengine/images
          • ImagesServlet.java
        • webapp/WEB-INF
          • web.xml
    • logs
      • pom.xml
      • src/main
        • java/com/example/appengine/logs
          • LogsServlet.java
        • webapp/WEB-INF
          • web.xml
    • memcache
      • pom.xml
      • src/main
        • java/com/example/appengine/memcache
          • MemcacheAsyncCacheServlet.java
          • MemcacheBestPracticeServlet.java
          • MemcacheConcurrentServlet.java
          • MemcacheSyncCacheServlet.java
        • webapp/WEB-INF
          • web.xml
    • oauth2
      • pom.xml
      • src/main
        • java/com/example/appengine
          • HelloServlet.java
          • Oauth2Filter.java
        • webapp
          • WEB-INF
            • web.xml
          • oauth2.html
    • remote-server/src/main
      • java/com/example/appengine/remote
        • RemoteServlet.java
      • webapp/WEB-INF
        • web.xml
    • requests
      • README.md
      • pom.xml
      • src/main
        • java/com/example/appengine/requests
          • LoggingServlet.java
          • RequestsServlet.java
        • webapp/WEB-INF
          • web.xml
    • search
      • README.md
      • pom.xml
      • src/main
        • java/com/example/appengine/search
          • DeleteServlet.java
          • DocumentServlet.java
          • IndexServlet.java
          • SchemaServlet.java
          • SearchOptionServlet.java
          • SearchServlet.java
        • webapp/WEB-INF
          • web.xml
    • taskqueues-deferred
      • pom.xml
      • src/main
        • java/com/google/cloud/taskqueue/samples
          • DeferSampleServlet.java
        • webapp
          • WEB-INF
            • web.xml
          • guestbook.jsp
    • taskqueues-pull
      • pom.xml
      • src/main
        • java/com/example/taskqueue
          • TaskqueueServlet.java
        • webapp
          • WEB-INF
            • web.xml
          • taskqueues-pull.jsp
    • taskqueues-push
      • pom.xml
      • src/main
        • java/com/example/appengine/taskqueue/push
          • Enqueue.java
          • Worker.java
        • webapp
          • WEB-INF
            • web.xml
          • taskqueue-push.html

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎appengine-java8/images/pom.xml‎

Copy file name to clipboardExpand all lines: appengine-java8/images/pom.xml
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Copyright 2015 Google Inc.
5252
<scope>provided</scope>
5353
</dependency>
5454
</dependencies>
55+
5556
<build>
5657
<!-- for hot reload of the web application -->
5758
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
@@ -65,6 +66,12 @@ Copyright 2015 Google Inc.
6566
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
6667
</configuration>
6768
</plugin>
69+
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-war-plugin</artifactId>
73+
<version>3.1.0</version>
74+
</plugin>
6875
</plugins>
6976
</build>
7077
</project>
Collapse file

‎appengine-java8/images/src/main/java/com/example/appengine/images/ImagesServlet.java‎

Copy file name to clipboardExpand all lines: appengine-java8/images/src/main/java/com/example/appengine/images/ImagesServlet.java
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
package com.example.appengine.images;
18+
1819
import com.google.appengine.api.blobstore.BlobKey;
1920
import com.google.appengine.api.blobstore.BlobstoreService;
2021
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
@@ -35,12 +36,16 @@
3536
import java.nio.ByteBuffer;
3637
import java.nio.channels.FileChannel;
3738

39+
import javax.servlet.annotation.WebServlet;
3840
import javax.servlet.http.HttpServlet;
3941
import javax.servlet.http.HttpServletRequest;
4042
import javax.servlet.http.HttpServletResponse;
4143

4244
// [START example]
4345
@SuppressWarnings("serial")
46+
@WebServlet(name = "images",
47+
description = "Images: Write an image to a bucket and display it in various sizes",
48+
urlPatterns = "/images")
4449
public class ImagesServlet extends HttpServlet {
4550
final String bucket = "YOUR-BUCKETNAME-HERE";
4651

@@ -59,7 +64,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
5964
// Read the image.jpg resource into a ByteBuffer.
6065
FileInputStream fileInputStream = new FileInputStream(new File("WEB-INF/image.jpg"));
6166
FileChannel fileChannel = fileInputStream.getChannel();
62-
ByteBuffer byteBuffer = ByteBuffer.allocate((int)fileChannel.size());
67+
ByteBuffer byteBuffer = ByteBuffer.allocate((int) fileChannel.size());
6368
fileChannel.read(byteBuffer);
6469

6570
byte[] imageBytes = byteBuffer.array();
Collapse file

‎appengine-java8/images/src/main/webapp/WEB-INF/web.xml‎

Copy file name to clipboardExpand all lines: appengine-java8/images/src/main/webapp/WEB-INF/web.xml
-30Lines changed: 0 additions & 30 deletions
This file was deleted.
Collapse file

‎appengine-java8/logs/pom.xml‎

Copy file name to clipboardExpand all lines: appengine-java8/logs/pom.xml
+62-56Lines changed: 62 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,68 @@
1515
limitations under the License.
1616
-->
1717
<project>
18-
<modelVersion>4.0.0</modelVersion>
19-
<packaging>war</packaging>
20-
<version>1.0-SNAPSHOT</version>
21-
<groupId>com.example.appengine</groupId>
22-
<artifactId>appengine-logs-j8</artifactId>
23-
<!-- Parent POM defines ${appengine.sdk.version} (updates frequently). -->
24-
<parent>
25-
<groupId>com.google.cloud</groupId>
26-
<artifactId>appengine-java8-samples</artifactId>
27-
<version>1.0.0</version>
28-
<relativePath>..</relativePath>
29-
</parent>
30-
<dependencies>
31-
<dependency>
32-
<groupId>com.google.appengine</groupId>
33-
<artifactId>appengine-api-1.0-sdk</artifactId>
34-
<version>${appengine.sdk.version}</version>
35-
</dependency>
36-
<dependency>
37-
<groupId>com.google.guava</groupId>
38-
<artifactId>guava</artifactId>
39-
<version>20.0</version>
40-
</dependency>
18+
<modelVersion>4.0.0</modelVersion>
19+
<packaging>war</packaging>
20+
<version>1.0-SNAPSHOT</version>
21+
<groupId>com.example.appengine</groupId>
22+
<artifactId>appengine-logs-j8</artifactId>
23+
<!-- Parent POM defines ${appengine.sdk.version} (updates frequently). -->
24+
<parent>
25+
<groupId>com.google.cloud</groupId>
26+
<artifactId>appengine-java8-samples</artifactId>
27+
<version>1.0.0</version>
28+
<relativePath>..</relativePath>
29+
</parent>
30+
<dependencies>
31+
<dependency>
32+
<groupId>com.google.appengine</groupId>
33+
<artifactId>appengine-api-1.0-sdk</artifactId>
34+
<version>${appengine.sdk.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>com.google.guava</groupId>
38+
<artifactId>guava</artifactId>
39+
<version>20.0</version>
40+
</dependency>
4141

42-
<dependency>
43-
<groupId>javax.servlet</groupId>
44-
<artifactId>javax.servlet-api</artifactId>
45-
<version>3.1.0</version>
46-
<type>jar</type>
47-
<scope>provided</scope>
48-
</dependency>
42+
<dependency>
43+
<groupId>javax.servlet</groupId>
44+
<artifactId>javax.servlet-api</artifactId>
45+
<version>3.1.0</version>
46+
<type>jar</type>
47+
<scope>provided</scope>
48+
</dependency>
4949

50-
<dependency>
51-
<groupId>org.json</groupId>
52-
<artifactId>json</artifactId>
53-
<version>20160810</version>
54-
</dependency>
55-
<dependency>
56-
<groupId>joda-time</groupId>
57-
<artifactId>joda-time</artifactId>
58-
<version>2.9.9</version>
59-
</dependency>
60-
</dependencies>
61-
<build>
62-
<!-- for hot reload of the web application -->
63-
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
64-
<plugins>
65-
<plugin>
66-
<groupId>com.google.cloud.tools</groupId>
67-
<artifactId>appengine-maven-plugin</artifactId>
68-
<version>1.3.1</version>
69-
<configuration>
70-
<deploy.promote>true</deploy.promote>
71-
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
72-
</configuration>
73-
</plugin>
74-
</plugins>
75-
</build>
50+
<dependency>
51+
<groupId>org.json</groupId>
52+
<artifactId>json</artifactId>
53+
<version>20160810</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>joda-time</groupId>
57+
<artifactId>joda-time</artifactId>
58+
<version>2.9.9</version>
59+
</dependency>
60+
</dependencies>
61+
<build>
62+
<!-- for hot reload of the web application -->
63+
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes
64+
</outputDirectory>
65+
<plugins>
66+
<plugin>
67+
<groupId>com.google.cloud.tools</groupId>
68+
<artifactId>appengine-maven-plugin</artifactId>
69+
<version>1.3.1</version>
70+
<configuration>
71+
<deploy.promote>true</deploy.promote>
72+
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
73+
</configuration>
74+
</plugin>
75+
<plugin>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-war-plugin</artifactId>
78+
<version>3.1.0</version>
79+
</plugin>
80+
</plugins>
81+
</build>
7682
</project>
Collapse file

‎appengine-java8/logs/src/main/java/com/example/appengine/logs/LogsServlet.java‎

Copy file name to clipboardExpand all lines: appengine-java8/logs/src/main/java/com/example/appengine/logs/LogsServlet.java
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525
import java.io.IOException;
2626
import java.io.PrintWriter;
2727

28+
import javax.servlet.annotation.WebServlet;
2829
import javax.servlet.http.HttpServlet;
2930
import javax.servlet.http.HttpServletRequest;
3031
import javax.servlet.http.HttpServletResponse;
3132

3233

3334
// Get request logs along with their app log lines and display them 5 at
3435
// a time, using a Next link to cycle through to the next 5.
36+
@WebServlet(name = "logs", description = "Logs: Display 5 lines of the request log",
37+
urlPatterns = "/logs")
3538
public class LogsServlet extends HttpServlet {
3639
@Override
3740
public void doGet(HttpServletRequest req, HttpServletResponse resp)
Collapse file

‎appengine-java8/logs/src/main/webapp/WEB-INF/web.xml‎

Copy file name to clipboardExpand all lines: appengine-java8/logs/src/main/webapp/WEB-INF/web.xml
-30Lines changed: 0 additions & 30 deletions
This file was deleted.
Collapse file

‎appengine-java8/memcache/pom.xml‎

Copy file name to clipboardExpand all lines: appengine-java8/memcache/pom.xml
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ Copyright 2015 Google Inc.
6363
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
6464
</configuration>
6565
</plugin>
66+
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-war-plugin</artifactId>
70+
<version>3.1.0</version>
71+
</plugin>
72+
6673
</plugins>
6774
</build>
6875
</project>
Collapse file

‎appengine-java8/memcache/src/main/java/com/example/appengine/memcache/MemcacheAsyncCacheServlet.java‎

Copy file name to clipboardExpand all lines: appengine-java8/memcache/src/main/java/com/example/appengine/memcache/MemcacheAsyncCacheServlet.java
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@
2727
import java.util.logging.Level;
2828

2929
import javax.servlet.ServletException;
30+
import javax.servlet.annotation.WebServlet;
3031
import javax.servlet.http.HttpServlet;
3132
import javax.servlet.http.HttpServletRequest;
3233
import javax.servlet.http.HttpServletResponse;
3334

3435
@SuppressWarnings("serial")
36+
@WebServlet(name = "MemcacheAsync", description = "Memcache: Async Access",
37+
urlPatterns = "/memcache/async")
3538
public class MemcacheAsyncCacheServlet extends HttpServlet {
3639

3740
@Override
Collapse file

‎appengine-java8/memcache/src/main/java/com/example/appengine/memcache/MemcacheBestPracticeServlet.java‎

Copy file name to clipboardExpand all lines: appengine-java8/memcache/src/main/java/com/example/appengine/memcache/MemcacheBestPracticeServlet.java
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@
2424
import java.util.logging.Level;
2525

2626
import javax.servlet.ServletException;
27+
import javax.servlet.annotation.WebServlet;
2728
import javax.servlet.http.HttpServlet;
2829
import javax.servlet.http.HttpServletRequest;
2930
import javax.servlet.http.HttpServletResponse;
3031

3132
// [START example]
3233
@SuppressWarnings("serial")
34+
@WebServlet(name = "memcache", description = "Memcache: Best Practices",
35+
urlPatterns = "/memcache")
3336
public class MemcacheBestPracticeServlet extends HttpServlet {
3437

3538
@Override
Collapse file

‎appengine-java8/memcache/src/main/java/com/example/appengine/memcache/MemcacheConcurrentServlet.java‎

Copy file name to clipboardExpand all lines: appengine-java8/memcache/src/main/java/com/example/appengine/memcache/MemcacheConcurrentServlet.java
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@
2424
import java.math.BigInteger;
2525

2626
import javax.servlet.ServletException;
27+
import javax.servlet.annotation.WebServlet;
2728
import javax.servlet.http.HttpServlet;
2829
import javax.servlet.http.HttpServletRequest;
2930
import javax.servlet.http.HttpServletResponse;
3031

3132
// [START example]
3233
@SuppressWarnings("serial")
34+
@WebServlet(name = "MemcacheConcurrent", description = "Memcache: Concurrent",
35+
urlPatterns = "/memcache/concurrent")
3336
public class MemcacheConcurrentServlet extends HttpServlet {
3437

3538
@Override

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.