This file contains hidden or 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
| import org.eclipse.microprofile.config.inject.ConfigProperty; | |
| import javax.inject.Inject; | |
| import javax.ws.rs.*; | |
| import javax.ws.rs.core.Response; | |
| @Path("sample") | |
| public class SampleResource { | |
| @Inject |
This file contains hidden or 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
| import java.io.Serializable; | |
| public class TestJsonRessource { | |
| private static final long serialVersionUID = 4254739092263227552L; | |
| private String name; | |
| private String age; | |
| public String getName() { | |
| return name; | |
| } |
This file contains hidden or 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
| @GET | |
| @Produces(MediaType.APPLICATION_JSON) | |
| @Path("/titans") | |
| public Response getTitans() { | |
| // src: https://attaque-des-titans.fandom.com/fr/wiki/Titans | |
| String titans[] = {"Titan Colossal", "Titan Cuirassé", "Titan Assaillant", "Titan Féminin", "Titan Mâchoire", | |
| "Titan Bestial", | |
| "Titan Charrette", | |
| "Titan Marteau d'Armes", "Titan Originel"}; | |
| return Response.ok(titans).build(); |
This file contains hidden or 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
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | |
| <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> | |
| <html> | |
| <head> | |
| <title>Première page JSP</title> | |
| <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"> | |
| <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"> | |
| <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"> | |
| <link rel="manifest" href="site.webmanifest"> |
This file contains hidden or 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
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | |
| <%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %> | |
| <html> | |
| <head> | |
| <title>Première page JSP</title> | |
| </head> | |
| <body> | |
| <p> | |
| <% | |
| out.print("Votre addresse IP est 🕵️: " + request.getRemoteAddr()); |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <web-app version="3.1" | |
| xmlns="http://xmlns.jcp.org/xml/ns/javaee" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> | |
| <welcome-file-list> | |
| <welcome-file>index.jsp</welcome-file> | |
| </welcome-file-list> |
This file contains hidden or 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
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>exec-maven-plugin</artifactId> | |
| <version>3.0.0</version> | |
| <configuration> | |
| <mainClass>com.mycompany.app.App</mainClass> | |
| </configuration> | |
| </plugin> |
This file contains hidden or 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
| import javax.swing.JFrame; | |
| import javax.swing.JLabel; | |
| import javax.swing.WindowConstants; | |
| public class SimpleGui { | |
| private static void createAndShowGUI() { | |
| // Create and set up the window. | |
| JFrame frame = new JFrame("HelloWorldSwing"); | |
| frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
This file contains hidden or 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
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.net.InetSocketAddress; | |
| import com.sun.net.httpserver.HttpExchange; | |
| import com.sun.net.httpserver.HttpHandler; | |
| import com.sun.net.httpserver.HttpServer; | |
| public class SimpleServer { |
This file contains hidden or 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
| Tutu, Tintin, Pikachu, Sangoku |