-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>catalog-servlet-sample</artifactId> | ||
<name>catalog-servlet-sample</name> | ||
<packaging>war</packaging> | ||
|
||
<parent> | ||
<groupId>com.store.catalog</groupId> | ||
<artifactId>catalog</artifactId> | ||
<version>2.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>servlet-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<finalName>sample</finalName> | ||
</build> | ||
|
||
|
||
</project> |
7 changes: 7 additions & 0 deletions
7
catalog-servlet-sample/src/main/java/com/store/catalog/servlet/MyFirstServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.store.catalog.servlet; | ||
|
||
import javax.servlet.http.HttpServlet; | ||
|
||
public class MyFirstServlet extends HttpServlet { | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
catalog-servlet-sample/src/main/java/com/store/catalog/servlet/Ping.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.store.catalog.servlet; | ||
|
||
import javax.servlet.GenericServlet; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
import javax.servlet.http.HttpServletRequest; | ||
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
|
||
public class Ping extends GenericServlet { | ||
@Override | ||
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { | ||
PrintWriter writer = servletResponse.getWriter(); | ||
writer.println("pong"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> | ||
|
||
|
||
|
||
<servlet> | ||
<servlet-name>Ping</servlet-name> | ||
<servlet-class>com.store.catalog.servlet.Ping</servlet-class> | ||
|
||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
<servlet-mapping> | ||
<servlet-name>Ping</servlet-name> | ||
<url-pattern>/ping</url-pattern> | ||
</servlet-mapping> | ||
</web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters