Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a comment about @WebServlet #692

Merged
merged 1 commit into from
Jun 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "analytics", description = "Analytics: Send Analytics Event to Google Analytics",
urlPatterns = "/analytics")
public class AnalyticsServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "appidentity", description = "AppIdentity: Get the Host Name",
urlPatterns = "/appidentity/identity")
public class IdentityServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "signforapp", description = "AppIdentity: Sign 'abcdefg'",
urlPatterns = "/appidentity/sign")
public class SignForAppServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "UrlShortener", description = "AppIdentity: Url Shortener",
urlPatterns = "/appidentity/shorten")
public class UrlShortenerServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "CloudSQL", description = "CloudSQL: Write low order IP address to Cloud SQL",
urlPatterns = "/cloudsql")
public class CloudSqlServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

// [START example]
@SuppressWarnings({"serial"})
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "GAEInfo", description = "GAEInfo: Write info about GAE Standard",
urlPatterns = "/gaeinfo")
//CHECKSTYLE:OFF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "images",
description = "Images: Write an image to a bucket and display it in various sizes",
urlPatterns = "/images")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

// Get request logs along with their app log lines and display them 5 at
// a time, using a Next link to cycle through to the next 5.
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "logs", description = "Logs: Display 5 lines of the request log",
urlPatterns = "/logs")
public class LogsServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "MemcacheAsync", description = "Memcache: Async Access",
urlPatterns = "/memcache/async")
public class MemcacheAsyncCacheServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "memcache", description = "Memcache: Best Practices",
urlPatterns = "/memcache")
public class MemcacheBestPracticeServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "MemcacheConcurrent", description = "Memcache: Concurrent",
urlPatterns = "/memcache/concurrent")
public class MemcacheConcurrentServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "MemcacheSync", description = "Memcache: Synchronous",
urlPatterns = "/memcache/sync")
public class MemcacheSyncCacheServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "oauth2", description = "Oauth2: restricted helloWorld",
urlPatterns = "/oauth2hello")
public class HelloServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* <p>Note - this is to demonstrate the OAuth2 APIs, as it is possible to lockdown some
* of your app's URL's using cloud console by adding service accounts to the project.</p>
*/
// With @WebFilter annotation the webapp/WEB-INF/web.xml is no longer required.
@WebFilter(urlPatterns = "/oauth2hello")
public class Oauth2Filter implements Filter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "remote", description = "Remote: yet another HelloWorld.",
urlPatterns = "/remote")
public class RemoteServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.servlet.http.HttpServletResponse;

// [START simple_logging_example]
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "RequestLogging", description = "Requests: Logging example",
urlPatterns = "/requests/log")
public class LoggingServlet extends HttpServlet {
Expand All @@ -39,6 +40,6 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp)
resp.getWriter().println("Check logs for results");
// [END_EXCLUDE]
}
}
}
// [END simple_logging_example]

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.servlet.http.HttpServletResponse;

// [START simple_request_example]
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "requests", description = "Requests: Trivial request",
urlPatterns = "/requests")
public class RequestsServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* interface to background a task on the AppEngine task queues,
* without needing to create a separate URL handler.
*/
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "TasksDefer", description = "TaskQueues: Defer a task",
urlPatterns = "/taskqueues/defer")
public class DeferSampleServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* Form Handling Servlet -- takes the form submission from /src/main/webapp/taskqueues-pull.jsp to
* add and delete tasks.
*/
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "TaskPull", description = "TaskQueues: Process some queues",
urlPatterns = "/taskqueues/queue")
public class TaskqueueServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

// [START enqueue]
// The Enqueue servlet should be mapped to the "/enqueue" URL.
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "TaskEnque", description = "taskqueue: Enqueue a job with a key",
urlPatterns = "/taskqueues/enqueue")
public class Enqueue extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

// [START worker]
// The Worker servlet should be mapped to the "/worker" URL.
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "TaskWorker", description = "TaskQueues: worker",
urlPatterns = "/taskqueues/worker")
public class Worker extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "URLFetch", description = "URLFetch: Write low order IP address to Cloud SQL",
urlPatterns = "/urlfetch")
public class UrlFetchServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(name = "UserAPI", description = "UserAPI: Login / Logout with UserService",
urlPatterns = "/userapi")
public class UsersServlet extends HttpServlet {
Expand Down