Skip to content

Commit 979fedc

Browse files
committed
Se prepara proyecto con dos servlets.
1 parent 72bcddc commit 979fedc

20 files changed

+90
-447
lines changed

.idea/.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.in28minutes</groupId>
5-
<artifactId>in28Minutes-first-webapp</artifactId>
4+
<groupId>curso.java</groupId>
5+
<artifactId>ejemplos-servlet</artifactId>
66
<version>0.0.1-SNAPSHOT</version>
77
<packaging>war</packaging>
88

@@ -18,11 +18,11 @@
1818
<artifactId>jstl</artifactId>
1919
<version>1.2</version>
2020
</dependency>
21-
22-
<dependency>
21+
22+
<dependency>
2323
<groupId>org.webjars</groupId>
2424
<artifactId>bootstrap</artifactId>
25-
<version>3.3.6</version>
25+
<version>3.4.0</version>
2626
</dependency>
2727
<dependency>
2828
<groupId>org.webjars</groupId>
@@ -32,29 +32,29 @@
3232
</dependencies>
3333

3434
<build>
35-
<pluginManagement>
36-
<plugins>
37-
<plugin>
38-
<groupId>org.apache.maven.plugins</groupId>
39-
<artifactId>maven-compiler-plugin</artifactId>
40-
<version>3.2</version>
41-
<configuration>
42-
<verbose>true</verbose>
43-
<source>1.7</source>
44-
<target>1.7</target>
45-
<showWarnings>true</showWarnings>
46-
</configuration>
47-
</plugin>
48-
<plugin>
49-
<groupId>org.apache.tomcat.maven</groupId>
50-
<artifactId>tomcat7-maven-plugin</artifactId>
51-
<version>2.2</version>
52-
<configuration>
53-
<path>/</path>
54-
<contextReloadable>true</contextReloadable>
55-
</configuration>
56-
</plugin>
57-
</plugins>
58-
</pluginManagement>
35+
<plugins>
36+
<plugin>
37+
<artifactId>maven-compiler-plugin</artifactId>
38+
<configuration>
39+
<encoding>UTF-8</encoding>
40+
<source>1.8</source>
41+
<target>1.8</target>
42+
</configuration>
43+
</plugin>
44+
<plugin>
45+
<groupId>org.eclipse.jetty</groupId>
46+
<artifactId>jetty-maven-plugin</artifactId>
47+
<version>9.3.0.v20150612</version>
48+
<configuration>
49+
<scanIntervalSeconds>10</scanIntervalSeconds>
50+
<scanTargets>
51+
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
52+
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
53+
</scanTargets>
54+
<stopKey/>
55+
<stopPort/>
56+
</configuration>
57+
</plugin>
58+
</plugins>
5959
</build>
6060
</project>

src/main/java/com/in28minutes/login/LoginService.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/main/java/com/in28minutes/login/LoginServlet.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/main/java/com/in28minutes/logout/LogoutServlet.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/main/java/com/in28minutes/todo/AddTodoServlet.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/main/java/com/in28minutes/todo/DeleteTodoServlet.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main/java/com/in28minutes/todo/ListTodoServlet.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main/java/com/in28minutes/todo/Todo.java

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/main/java/com/in28minutes/todo/TodoService.java

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package ejemplos.servlet.curso;
2+
3+
import javax.servlet.ServletException;
4+
import javax.servlet.annotation.WebServlet;
5+
import javax.servlet.http.HttpServlet;
6+
import javax.servlet.http.HttpServletRequest;
7+
import javax.servlet.http.HttpServletResponse;
8+
import java.io.IOException;
9+
import java.io.PrintWriter;
10+
11+
@WebServlet(urlPatterns = "/myServlet")
12+
public class MyServlet extends HttpServlet {
13+
14+
protected void doGet(HttpServletRequest request,
15+
HttpServletResponse response) throws ServletException, IOException {
16+
17+
response.setContentType("text/html");
18+
PrintWriter out = response.getWriter();
19+
20+
// send HTML page to client
21+
out.println("<html>");
22+
out.println("<head><title>Ejemplo HTML desde Servlet</title></head>");
23+
out.println("<body>");
24+
out.println("<h1>Ejemplo Servlet</h1>");
25+
out.println("<p>Este es un ejemplo en el curso de Java para generar HTML desde un Servlet.</p>");
26+
out.println("<p><a href=\"/myServlet2\">Vamos al otro Servlet</a></p>");
27+
out.println("</body></html>");
28+
}
29+
30+
}

0 commit comments

Comments
 (0)