diff --git a/java/samples/rest/CustomeRestClient/.idea/.gitignore b/java/samples/rest/CustomeRestClient/.idea/.gitignore new file mode 100644 index 0000000..4aa91ea --- /dev/null +++ b/java/samples/rest/CustomeRestClient/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/java/samples/rest/CustomeRestClient/.idea/compiler.xml b/java/samples/rest/CustomeRestClient/.idea/compiler.xml new file mode 100644 index 0000000..c54dad6 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/.idea/compiler.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/CustomeRestClient/.idea/jarRepositories.xml b/java/samples/rest/CustomeRestClient/.idea/jarRepositories.xml new file mode 100644 index 0000000..a468a99 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/CustomeRestClient/.idea/misc.xml b/java/samples/rest/CustomeRestClient/.idea/misc.xml new file mode 100644 index 0000000..a7657a2 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/.idea/misc.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/CustomeRestClient/.idea/runConfigurations.xml b/java/samples/rest/CustomeRestClient/.idea/runConfigurations.xml new file mode 100644 index 0000000..93e4b17 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/java/samples/rest/CustomeRestClient/pom.xml b/java/samples/rest/CustomeRestClient/pom.xml new file mode 100644 index 0000000..2e5fe1c --- /dev/null +++ b/java/samples/rest/CustomeRestClient/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.example + CustomeRestClient + 1.0-SNAPSHOT + + + 11 + 11 + + + + + org.glassfish.jersey.core + jersey-client + 2.35 + + + org.glassfish.jersey.inject + jersey-hk2 + 2.35 + + + org.glassfish.jersey.media + jersey-media-json-jackson + 2.35 + + + org.projectlombok + lombok + 1.18.28 + provided + + + + + \ No newline at end of file diff --git a/java/samples/rest/CustomeRestClient/src/main/java/mainpack/Domain.java b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/Domain.java new file mode 100644 index 0000000..eb89a94 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/Domain.java @@ -0,0 +1,16 @@ +package mainpack; + +import lombok.Data; + +import java.sql.Date; + +@Data +public class Domain { + + private long id; + private String domainName; + private String ip; + private Date dateReg; + private String countryReg; + private Person person; +} diff --git a/java/samples/rest/CustomeRestClient/src/main/java/mainpack/MainClass.java b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/MainClass.java new file mode 100644 index 0000000..e0d61e0 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/MainClass.java @@ -0,0 +1,12 @@ +package mainpack; + +public class MainClass { + + public static void main(String[] args) { + RestClient client = new RestClient(); + + Domain domain = client.getDomainById(1L); + domain.setCountryReg("Blabla"); + client.updateDomain(domain); + } +} diff --git a/java/samples/rest/CustomeRestClient/src/main/java/mainpack/Person.java b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/Person.java new file mode 100644 index 0000000..51a1ee2 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/Person.java @@ -0,0 +1,17 @@ +package mainpack; + +import lombok.Data; + +import java.util.HashSet; +import java.util.Set; + +@Data +public class Person { + + private long id; + private String firstName; + private String lastName; + private String email; + private String gender; + private Set domainEntitySet = new HashSet<>(); +} diff --git a/java/samples/rest/CustomeRestClient/src/main/java/mainpack/RestClient.java b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/RestClient.java new file mode 100644 index 0000000..c72ff07 --- /dev/null +++ b/java/samples/rest/CustomeRestClient/src/main/java/mainpack/RestClient.java @@ -0,0 +1,27 @@ +package mainpack; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import java.util.List; + +public class RestClient { + private final Client client = ClientBuilder.newClient(); + + private String URL = "http://localhost:8080/dev_j200_2-1.0-SNAPSHOT/api/domain"; + + public List getAllDomain(){ + return client.target(URL).request(MediaType.APPLICATION_JSON).get(new GenericType>(){}); + } + + public Domain getDomainById(Long id) { + return client.target(URL + "/" + id).request(MediaType.APPLICATION_JSON).get(Domain.class); + } + + public void updateDomain(Domain domain){ + client.target(URL).request().put(Entity.entity(domain, MediaType.APPLICATION_JSON)); + } + +} diff --git a/java/samples/rest/CustomeRestClient/target/classes/mainpack/Domain.class b/java/samples/rest/CustomeRestClient/target/classes/mainpack/Domain.class new file mode 100644 index 0000000..551cf49 Binary files /dev/null and b/java/samples/rest/CustomeRestClient/target/classes/mainpack/Domain.class differ diff --git a/java/samples/rest/CustomeRestClient/target/classes/mainpack/MainClass.class b/java/samples/rest/CustomeRestClient/target/classes/mainpack/MainClass.class new file mode 100644 index 0000000..10313bb Binary files /dev/null and b/java/samples/rest/CustomeRestClient/target/classes/mainpack/MainClass.class differ diff --git a/java/samples/rest/CustomeRestClient/target/classes/mainpack/Person.class b/java/samples/rest/CustomeRestClient/target/classes/mainpack/Person.class new file mode 100644 index 0000000..2e7c04b Binary files /dev/null and b/java/samples/rest/CustomeRestClient/target/classes/mainpack/Person.class differ diff --git a/java/samples/rest/CustomeRestClient/target/classes/mainpack/RestClient$1.class b/java/samples/rest/CustomeRestClient/target/classes/mainpack/RestClient$1.class new file mode 100644 index 0000000..733a74e Binary files /dev/null and b/java/samples/rest/CustomeRestClient/target/classes/mainpack/RestClient$1.class differ diff --git a/java/samples/rest/CustomeRestClient/target/classes/mainpack/RestClient.class b/java/samples/rest/CustomeRestClient/target/classes/mainpack/RestClient.class new file mode 100644 index 0000000..2c37990 Binary files /dev/null and b/java/samples/rest/CustomeRestClient/target/classes/mainpack/RestClient.class differ diff --git a/java/samples/rest/dev_j200_2/.idea/.gitignore b/java/samples/rest/dev_j200_2/.idea/.gitignore new file mode 100644 index 0000000..4aa91ea --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/java/samples/rest/dev_j200_2/.idea/artifacts/dev_j200_2_war.xml b/java/samples/rest/dev_j200_2/.idea/artifacts/dev_j200_2_war.xml new file mode 100644 index 0000000..f5082ad --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/artifacts/dev_j200_2_war.xml @@ -0,0 +1,16 @@ + + + $PROJECT_DIR$/target + + + false + dev_j200_2 + war + false + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/artifacts/dev_j200_2_war_exploded.xml b/java/samples/rest/dev_j200_2/.idea/artifacts/dev_j200_2_war_exploded.xml new file mode 100644 index 0000000..d72ffa5 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/artifacts/dev_j200_2_war_exploded.xml @@ -0,0 +1,24 @@ + + + $PROJECT_DIR$/target/dev_j200_2-1.0-SNAPSHOT + + + true + dev_j200_2 + war + false + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/compiler.xml b/java/samples/rest/dev_j200_2/.idea/compiler.xml new file mode 100644 index 0000000..8f894a6 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/dataSources.xml b/java/samples/rest/dev_j200_2/.idea/dataSources.xml new file mode 100644 index 0000000..8e3dadd --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/dataSources.xml @@ -0,0 +1,12 @@ + + + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306/test_db + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/encodings.xml b/java/samples/rest/dev_j200_2/.idea/encodings.xml new file mode 100644 index 0000000..a156f52 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/jarRepositories.xml b/java/samples/rest/dev_j200_2/.idea/jarRepositories.xml new file mode 100644 index 0000000..a468a99 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/jpa-buddy.xml b/java/samples/rest/dev_j200_2/.idea/jpa-buddy.xml new file mode 100644 index 0000000..a9da95e --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_2_1_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_2_1_0.xml new file mode 100644 index 0000000..cdcf4b0 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_2_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_ejb_jakarta_ejb_api_4_0_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_ejb_jakarta_ejb_api_4_0_0.xml new file mode 100644 index 0000000..6bdef19 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_ejb_jakarta_ejb_api_4_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_3_0_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_3_0_0.xml new file mode 100644 index 0000000..ca439d5 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_3_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_servlet_jakarta_servlet_api_5_0_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_servlet_jakarta_servlet_api_5_0_0.xml new file mode 100644 index 0000000..5898da1 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_servlet_jakarta_servlet_api_5_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_2_0_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_2_0_0.xml new file mode 100644 index 0000000..d804791 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_2_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_ws_rs_jakarta_ws_rs_api_3_1_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_ws_rs_jakarta_ws_rs_api_3_1_0.xml new file mode 100644 index 0000000..8923629 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_ws_rs_jakarta_ws_rs_api_3_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_4_0_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_4_0_0.xml new file mode 100644 index 0000000..8c9bb1c --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_4_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml new file mode 100644 index 0000000..e6ecab0 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_7_1.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_7_1.xml new file mode 100644 index 0000000..5f679c4 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_7_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_7_1.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_7_1.xml new file mode 100644 index 0000000..212e846 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_7_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_7_1.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_7_1.xml new file mode 100644 index 0000000..ea11ca3 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_7_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_7_1.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_7_1.xml new file mode 100644 index 0000000..f7fb58a --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_7_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml new file mode 100644 index 0000000..718b32e --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/misc.xml b/java/samples/rest/dev_j200_2/.idea/misc.xml new file mode 100644 index 0000000..63da7e8 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/misc.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/modules.xml b/java/samples/rest/dev_j200_2/.idea/modules.xml new file mode 100644 index 0000000..a1ffbe1 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/.idea/runConfigurations.xml b/java/samples/rest/dev_j200_2/.idea/runConfigurations.xml new file mode 100644 index 0000000..93e4b17 --- /dev/null +++ b/java/samples/rest/dev_j200_2/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/dev_j200_2.iml b/java/samples/rest/dev_j200_2/dev_j200_2.iml new file mode 100644 index 0000000..c3d5a14 --- /dev/null +++ b/java/samples/rest/dev_j200_2/dev_j200_2.iml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/pom.xml b/java/samples/rest/dev_j200_2/pom.xml new file mode 100644 index 0000000..78d8815 --- /dev/null +++ b/java/samples/rest/dev_j200_2/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + com.example + dev_j200_2 + 1.0-SNAPSHOT + dev_j200_2 + war + + + UTF-8 + 1.8 + 1.8 + 5.7.1 + + + + + jakarta.ejb + jakarta.ejb-api + 4.0.0 + provided + + + jakarta.persistence + jakarta.persistence-api + 3.0.0 + provided + + + jakarta.servlet + jakarta.servlet-api + 5.0.0 + provided + + + jakarta.ws.rs + jakarta.ws.rs-api + 3.1.0 + + + jakarta.xml.bind + jakarta.xml.bind-api + 4.0.0 + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.1 + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/HelloServlet.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/HelloServlet.java new file mode 100644 index 0000000..0a2f0d9 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/HelloServlet.java @@ -0,0 +1,58 @@ +package com.example.dev_j200_2; + +import java.io.*; +import java.util.List; + +import com.example.dev_j200_2.entities.DomainEntity; +import com.example.dev_j200_2.entities.PersonEntity; +import com.example.dev_j200_2.entities.UsersEntity; +import com.example.dev_j200_2.repo.AppRepositoryI; +import jakarta.ejb.EJB; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.*; +import jakarta.servlet.annotation.*; + +@WebServlet(name = "helloServlet", value = "/hello-servlet") +public class HelloServlet extends HttpServlet { + @EJB + private AppRepositoryI repository; + private String message; + + public void init() { + message = "Hello World!"; + } + + public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setContentType("text/html"); + List persons = repository.findAllPerson(); + List domains = repository.findAll(DomainEntity.class); + // Hello + PrintWriter out = response.getWriter(); + out.println(""); + out.println("

" + message + "

"); + out.println("

" + repository.findById(PersonEntity.class, 1) + "

"); + out.println("

" + repository.findById(DomainEntity.class, 1) + "

"); + out.println("

" + repository.findById(UsersEntity.class, 1) + "

"); + persons.forEach(val -> { + out.println("

" + val + "

"); + }); + out.println(""); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String username = request.getParameter("username"); + String password = request.getParameter("password"); + + boolean check = new UserStore().checkUser(username, password); + if(check) getServletContext().getRequestDispatcher("/ServletViewList").forward(request, response); + else { + String message = "Логин или пароль не найдены"; + request.setAttribute("message", message); + getServletContext().getRequestDispatcher("/ServletInfo").forward(request, response); + } + } + + public void destroy() { + } +} \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/Passport.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/Passport.java new file mode 100644 index 0000000..7e5569a --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/Passport.java @@ -0,0 +1,51 @@ +package com.example.dev_j200_2; + +import java.util.Objects; + +public class Passport { + private int serial; + private int number; + private Person person; + + public Passport(int serial, int number) { + this.serial = serial; + this.number = number; + } + + public int getSerial() { + return serial; + } + + public void setSerial(int serial) { + this.serial = serial; + } + + public int getNumber() { + return number; + } + + public void setNumber(int number) { + this.number = number; + } + + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Passport passport = (Passport) o; + return serial == passport.serial && number == passport.number; + } + + @Override + public int hashCode() { + return Objects.hash(serial, number); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/Person.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/Person.java new file mode 100644 index 0000000..20a888c --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/Person.java @@ -0,0 +1,55 @@ +package com.example.dev_j200_2; + +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +public class Person { + private long id; + private String name; + private Set passports; + + public Person(long id, String name) { + passports = new HashSet<>(); + this.id = id; + this.name = name; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Set getPassports() { + return new HashSet<>(passports); + } + + public void addPassport(Passport passport){ + passports.add(passport); + passport.setPerson(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Person person = (Person) o; + return id == person.id && name.equals(person.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/PersonService.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/PersonService.java new file mode 100644 index 0000000..17a315a --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/PersonService.java @@ -0,0 +1,11 @@ +package com.example.dev_j200_2; + +import jakarta.ejb.Local; + +import java.util.Set; + +@Local +public interface PersonService { + + Set getAllPerson(); +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/PersonServiceImpl.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/PersonServiceImpl.java new file mode 100644 index 0000000..36ccd12 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/PersonServiceImpl.java @@ -0,0 +1,38 @@ +package com.example.dev_j200_2; + +import jakarta.ejb.Stateful; + +import java.util.HashSet; +import java.util.Set; + +@Stateful +public class PersonServiceImpl implements PersonService{ + + private static Set persons; + + static { + persons = new HashSet<>(); + Person p1 = new Person(1, "Andrey"); + p1.addPassport(new Passport(5654, 548785)); + persons.add(p1); + Person p2 = new Person(2, "Michail"); + p2.addPassport(new Passport(1234, 55685)); + p2.addPassport(new Passport(4321, 57785)); + persons.add(p2); + Person p3 = new Person(3, "Olga"); + p3.addPassport(new Passport(4500, 236777)); + persons.add(p3); + Person p4 = new Person(4, "Yana"); + p4.addPassport(new Passport(1204, 521004)); + persons.add(p4); + Person p5 = new Person(5, "Alexsandr"); + p5.addPassport(new Passport(9513, 300540)); + persons.add(p5); + persons.add(new Person(6, "Boby")); + } + + @Override + public Set getAllPerson() { + return persons; + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/ServletInfo.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/ServletInfo.java new file mode 100644 index 0000000..40d7acf --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/ServletInfo.java @@ -0,0 +1,32 @@ +package com.example.dev_j200_2; + +import jakarta.servlet.*; +import jakarta.servlet.http.*; +import jakarta.servlet.annotation.*; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; + +@WebServlet(name = "ServletInfo", value = "/ServletInfo") +public class ServletInfo extends HttpServlet { + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + sendResponse(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + sendResponse(request, response); + } + + private void sendResponse(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setContentType("text/html; charset=UTF-8"); + request.setCharacterEncoding("UTF-8"); + String message = (String)request.getAttribute("message"); + PrintWriter out = response.getWriter(); + out.println(""); + out.println("

" + message + "

"); + out.println(""); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/ServletViewList.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/ServletViewList.java new file mode 100644 index 0000000..4641e26 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/ServletViewList.java @@ -0,0 +1,93 @@ +package com.example.dev_j200_2; + +import jakarta.ejb.EJB; +import jakarta.servlet.*; +import jakarta.servlet.http.*; +import jakarta.servlet.annotation.*; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.*; + +@WebServlet(name = "ServletViewList", value = "/ServletViewList") +public class ServletViewList extends HttpServlet { + + @EJB + private PersonService personService; + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { + sendResponse(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { + sendResponse(request, response); + } + + private void sendResponse(HttpServletRequest request, HttpServletResponse response) throws IOException { + String filterParam = request.getParameter("filter"); + Map> personMap = filter(personService.getAllPerson(), filterParam); + response.setContentType("text/html; charset=UTF-8"); + request.setCharacterEncoding("UTF-8"); + PrintWriter out = response.getWriter(); + out.println(""); + out.println("

Все персоны

"); + out.println("
\n" + + " \n" + + " \n" + + "


"); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + for(Person person : personMap.keySet()){ + if(person.getPassports().size()>0) { + for(Passport passport : personMap.get(person)) { + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + } + }else { + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + } + } + out.println("
IDNAMESERIALNUMBER
" + person.getId() + "" + person.getName() + "" + passport.getSerial() + "" + passport.getNumber() + "
" + person.getId() + "" + person.getName() + "
"); + out.println(""); + } + + private Map> filter(Set persons, String filterparam){ + Map> personMap = new HashMap<>(); + for (Person person : persons) { + personMap.put(person, person.getPassports()); + } + if(filterparam!=null && !filterparam.isEmpty()) { + Iterator personIter = personMap.keySet().iterator(); + while (personIter.hasNext()){ + Person person = personIter.next(); + if(!person.getName().toLowerCase().contains(filterparam.toLowerCase())){ + Iterator passportIter = personMap.get(person).iterator(); + while (passportIter.hasNext()){ + Passport passport = passportIter.next(); + if(!(passport.getSerial() + "" + passport.getNumber()).contains(filterparam)){ + passportIter.remove(); + } + } + if(personMap.get(person).size()==0) personIter.remove(); + } + } + } + return personMap; + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/User.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/User.java new file mode 100644 index 0000000..1b2eb4a --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/User.java @@ -0,0 +1,42 @@ +package com.example.dev_j200_2; + +import java.util.Objects; + +public class User { + private String name; + private String password; + + public User(String name, String password) { + this.name = name; + this.password = password; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + User user = (User) o; + return name.equals(user.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/UserStore.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/UserStore.java new file mode 100644 index 0000000..0b67b79 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/UserStore.java @@ -0,0 +1,22 @@ +package com.example.dev_j200_2; + +import java.util.HashSet; +import java.util.Set; + +public class UserStore { + private static Set users; + + static { + users = new HashSet<>(); + users.add(new User("Andrey", "123qwe")); + users.add(new User("Michail", "123qwe")); + users.add(new User("Olga", "123qwe")); + users.add(new User("Yana", "123qwe")); + users.add(new User("Alexsandr", "123qwe")); + } + + public boolean checkUser(String username, String password){ + User temp = new User(username, password); + return users.contains(temp); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestConfig.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestConfig.java new file mode 100644 index 0000000..1b89f15 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestConfig.java @@ -0,0 +1,18 @@ +package com.example.dev_j200_2.api; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +import java.util.HashSet; +import java.util.Set; + +@ApplicationPath("api") +public class RestConfig extends Application { + @Override + public Set> getClasses() { + Set> resources = new HashSet<>(); + resources.add(RestPersonService.class); + resources.add(RestDomainService.class); + return resources; + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestDomainService.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestDomainService.java new file mode 100644 index 0000000..b362f1c --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestDomainService.java @@ -0,0 +1,51 @@ +package com.example.dev_j200_2.api; + +import com.example.dev_j200_2.entities.DomainEntity; +import com.example.dev_j200_2.repo.AppRepositoryI; +import jakarta.ejb.EJB; +import jakarta.ejb.Stateless; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; + +import java.util.List; + +@Stateless +@Path("domain") +public class RestDomainService { + + @EJB + private AppRepositoryI repository; + + //localhost:8080/sameApp/api/domain/1 + @GET + @Produces(MediaType.APPLICATION_JSON) + public List getAll(){ + return repository.findAll(DomainEntity.class); + } + + @GET + @Path("{id}") + @Produces(MediaType.APPLICATION_JSON) + public DomainEntity getDomain(@PathParam("id") Long id){ + return repository.findById(DomainEntity.class, id); + } + + @DELETE + @Path("{id}") + public void delete(@PathParam("id") Long id){ + repository.delete(DomainEntity.class, id); + } + + @POST + @Consumes(MediaType.APPLICATION_JSON) + public void create(DomainEntity domain){ + repository.save(domain); + } + + @PUT + @Consumes(MediaType.APPLICATION_JSON) + public void update(DomainEntity domain){ + System.out.println(domain); + repository.update(domain); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestPersonService.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestPersonService.java new file mode 100644 index 0000000..78e5206 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/api/RestPersonService.java @@ -0,0 +1,26 @@ +package com.example.dev_j200_2.api; + +import com.example.dev_j200_2.entities.PersonEntity; +import com.example.dev_j200_2.repo.AppRepositoryI; +import jakarta.ejb.EJB; +import jakarta.ejb.Stateless; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +import java.util.List; + +@Stateless +@Path("person") +public class RestPersonService { + + @EJB + private AppRepositoryI repository; + + @GET + @Produces(MediaType.APPLICATION_JSON) + public List getAll(){ + return repository.findAll(PersonEntity.class); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/DomainEntity.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/DomainEntity.java new file mode 100644 index 0000000..61c42bd --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/DomainEntity.java @@ -0,0 +1,124 @@ +package com.example.dev_j200_2.entities; + +import jakarta.persistence.*; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlTransient; + +import java.sql.Date; + +@Entity +@XmlRootElement +@Table(name = "domain", schema = "test_db", catalog = "") +@NamedQueries({ + @NamedQuery(name = "Domain.All", query = "select d from DomainEntity d") +}) +public class DomainEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private long id; + @Basic + @Column(name = "domain_name") + private String domainName; + @Basic + @Column(name = "ip") + private String ip; + @Basic + @Column(name = "date_reg") + private Date dateReg; + @Basic + @Column(name = "country_reg") + private String countryReg; + @JoinColumn(name = "person") + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) + private PersonEntity person; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @XmlTransient + public PersonEntity getPerson() { + return person; + } + + public void setPerson(PersonEntity person) { + this.person = person; + } + + public String getDomainName() { + return domainName; + } + + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + + public Date getDateReg() { + return dateReg; + } + + public void setDateReg(Date dateReg) { + this.dateReg = dateReg; + } + + + public String getCountryReg() { + return countryReg; + } + + public void setCountryReg(String countryReg) { + this.countryReg = countryReg; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + DomainEntity that = (DomainEntity) o; + + if (id != that.id) return false; + if (domainName != null ? !domainName.equals(that.domainName) : that.domainName != null) return false; + if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false; + if (dateReg != null ? !dateReg.equals(that.dateReg) : that.dateReg != null) return false; + if (countryReg != null ? !countryReg.equals(that.countryReg) : that.countryReg != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = (int) (id ^ (id >>> 32)); + result = 31 * result + (domainName != null ? domainName.hashCode() : 0); + result = 31 * result + (ip != null ? ip.hashCode() : 0); + result = 31 * result + (dateReg != null ? dateReg.hashCode() : 0); + result = 31 * result + (countryReg != null ? countryReg.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "DomainEntity{" + + "id=" + id + + ", domainName='" + domainName + '\'' + + ", ip='" + ip + '\'' + + ", dateReg=" + dateReg + + ", countryReg='" + countryReg + '\'' + + '}'; + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/PersonEntity.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/PersonEntity.java new file mode 100644 index 0000000..47c67ec --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/PersonEntity.java @@ -0,0 +1,120 @@ +package com.example.dev_j200_2.entities; + +import jakarta.persistence.*; +import jakarta.xml.bind.annotation.XmlRootElement; + +import java.util.HashSet; +import java.util.Set; + +@Entity +@XmlRootElement +@Table(name = "person", schema = "test_db", catalog = "") +public class PersonEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private long id; + @Basic + @Column(name = "first_name") + private String firstName; + @Basic + @Column(name = "last_name") + private String lastName; + @Basic + @Column(name = "email") + private String email; + @Basic + @Column(name = "gender") + private String gender; + @OneToMany(mappedBy = "person", fetch = FetchType.EAGER) + private Set domainEntitySet = new HashSet<>(); + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public Set getDomainEntitySet() { + return domainEntitySet; + } + + public void setDomainEntitySet(Set domainEntitySet) { + this.domainEntitySet = domainEntitySet; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PersonEntity that = (PersonEntity) o; + + if (id != that.id) return false; + if (firstName != null ? !firstName.equals(that.firstName) : that.firstName != null) return false; + if (lastName != null ? !lastName.equals(that.lastName) : that.lastName != null) return false; + if (email != null ? !email.equals(that.email) : that.email != null) return false; + if (gender != null ? !gender.equals(that.gender) : that.gender != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = (int) (id ^ (id >>> 32)); + result = 31 * result + (firstName != null ? firstName.hashCode() : 0); + result = 31 * result + (lastName != null ? lastName.hashCode() : 0); + result = 31 * result + (email != null ? email.hashCode() : 0); + result = 31 * result + (gender != null ? gender.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "PersonEntity{" + + "id=" + id + + ", firstName='" + firstName + '\'' + + ", lastName='" + lastName + '\'' + + ", email='" + email + '\'' + + ", gender='" + gender + '\'' + + ", domainEntitySet=" + domainEntitySet + + '}'; + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/UsersEntity.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/UsersEntity.java new file mode 100644 index 0000000..d335987 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/entities/UsersEntity.java @@ -0,0 +1,63 @@ +package com.example.dev_j200_2.entities; + +import jakarta.persistence.*; + +@Entity +@Table(name = "users", schema = "test_db", catalog = "") +public class UsersEntity { + private long id; + private String username; + private String userpass; + + @Id + @Column(name = "id") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Basic + @Column(name = "username") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + @Basic + @Column(name = "userpass") + public String getUserpass() { + return userpass; + } + + public void setUserpass(String userpass) { + this.userpass = userpass; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + UsersEntity that = (UsersEntity) o; + + if (id != that.id) return false; + if (username != null ? !username.equals(that.username) : that.username != null) return false; + if (userpass != null ? !userpass.equals(that.userpass) : that.userpass != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = (int) (id ^ (id >>> 32)); + result = 31 * result + (username != null ? username.hashCode() : 0); + result = 31 * result + (userpass != null ? userpass.hashCode() : 0); + return result; + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/repo/AppRepository.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/repo/AppRepository.java new file mode 100644 index 0000000..9e80e99 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/repo/AppRepository.java @@ -0,0 +1,76 @@ +package com.example.dev_j200_2.repo; + +import com.example.dev_j200_2.entities.DomainEntity; +import com.example.dev_j200_2.entities.PersonEntity; +import com.example.dev_j200_2.entities.UsersEntity; +import jakarta.ejb.Singleton; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Root; +import jakarta.persistence.metamodel.Metamodel; + +import java.util.List; + +@Singleton +public class AppRepository implements AppRepositoryI { + @PersistenceContext + private EntityManager em; + + @Override + public List findAll(Class clazz) { + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(clazz); + Metamodel m = em.getMetamodel(); + Root obj = cq.from(clazz); + return em.createQuery(cq.select(obj)).getResultList(); + } + @Override + public T findById(Class clazz, long id) { + return em.find(clazz, id); + } + + @Override + public void delete(Class clazz, long id) { + T entity = em.find(clazz, id); + em.remove(entity); + } + + @Override + public void save(T entity) { + em.persist(entity); + } + + @Override + public void update(T entity) { + em.merge(entity); + em.flush(); + } + + @Override + public List findAllPerson() { + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(PersonEntity.class); + Root root = cq.from(PersonEntity.class); + cq.select(root); + return em.createQuery(cq).getResultList(); + } + + @Override + public List findAllDomain() { + return em.createNamedQuery("Domain.All", DomainEntity.class).getResultList(); + } + + + + @Override + public PersonEntity findPersonById(long id) { + return em.find(PersonEntity.class, id); + } + + @Override + public UsersEntity findUserById(long id) { + return em.find(UsersEntity.class, id); + } +} diff --git a/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/repo/AppRepositoryI.java b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/repo/AppRepositoryI.java new file mode 100644 index 0000000..86c1095 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/java/com/example/dev_j200_2/repo/AppRepositoryI.java @@ -0,0 +1,23 @@ +package com.example.dev_j200_2.repo; + +import com.example.dev_j200_2.entities.DomainEntity; +import com.example.dev_j200_2.entities.PersonEntity; +import com.example.dev_j200_2.entities.UsersEntity; +import jakarta.ejb.Local; + +import java.util.List; +import java.util.Set; + +@Local +public interface AppRepositoryI { + + List findAllPerson(); + List findAllDomain(); + List findAll(Class clazz); + PersonEntity findPersonById(long id); + UsersEntity findUserById(long id); + T findById(Class clazz, long id); + void delete(Class clazz, long id); + void save(T entity); + void update(T entity); +} diff --git a/java/samples/rest/dev_j200_2/src/main/resources/META-INF/persistence.xml b/java/samples/rest/dev_j200_2/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..f1b8d94 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,9 @@ + + + + java:/test_db + + diff --git a/java/samples/rest/dev_j200_2/src/main/webapp/WEB-INF/web.xml b/java/samples/rest/dev_j200_2/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..dbb4271 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/src/main/webapp/index.jsp b/java/samples/rest/dev_j200_2/src/main/webapp/index.jsp new file mode 100644 index 0000000..cee00fb --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/webapp/index.jsp @@ -0,0 +1,20 @@ +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + JSP - Hello World + + +

<%= "Authorization" %> +

+
+Hello Servlet +
+
+

+
+

+ +
+ + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/src/main/webapp/same.html b/java/samples/rest/dev_j200_2/src/main/webapp/same.html new file mode 100644 index 0000000..46c6335 --- /dev/null +++ b/java/samples/rest/dev_j200_2/src/main/webapp/same.html @@ -0,0 +1,27 @@ + + + + + Title + + +
+ + +
+ + + + + + + + + + + + + +
IDNAMESERIALNUMBER
+ + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/target/classes/META-INF/persistence.xml b/java/samples/rest/dev_j200_2/target/classes/META-INF/persistence.xml new file mode 100644 index 0000000..f1b8d94 --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/classes/META-INF/persistence.xml @@ -0,0 +1,9 @@ + + + + java:/test_db + + diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/HelloServlet.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/HelloServlet.class new file mode 100644 index 0000000..25a7d7e Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/HelloServlet.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/Passport.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/Passport.class new file mode 100644 index 0000000..ac85b91 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/Passport.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/Person.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/Person.class new file mode 100644 index 0000000..99b9c45 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/Person.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/PersonService.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/PersonService.class new file mode 100644 index 0000000..556ef76 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/PersonService.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/PersonServiceImpl.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/PersonServiceImpl.class new file mode 100644 index 0000000..18ba55f Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/PersonServiceImpl.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/ServletInfo.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/ServletInfo.class new file mode 100644 index 0000000..298d0a1 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/ServletInfo.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/ServletViewList.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/ServletViewList.class new file mode 100644 index 0000000..b3cb7e6 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/ServletViewList.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/User.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/User.class new file mode 100644 index 0000000..8f562cc Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/User.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/UserStore.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/UserStore.class new file mode 100644 index 0000000..76d0015 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/UserStore.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestConfig.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestConfig.class new file mode 100644 index 0000000..a87e23b Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestConfig.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestDomainService.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestDomainService.class new file mode 100644 index 0000000..89ac38b Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestDomainService.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestPersonService.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestPersonService.class new file mode 100644 index 0000000..1f3cb0f Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/api/RestPersonService.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/DomainEntity.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/DomainEntity.class new file mode 100644 index 0000000..b62e599 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/DomainEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/PersonEntity.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/PersonEntity.class new file mode 100644 index 0000000..b30723d Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/PersonEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/UsersEntity.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/UsersEntity.class new file mode 100644 index 0000000..8595553 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/entities/UsersEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/repo/AppRepository.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/repo/AppRepository.class new file mode 100644 index 0000000..ae55945 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/repo/AppRepository.class differ diff --git a/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/repo/AppRepositoryI.class b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/repo/AppRepositoryI.class new file mode 100644 index 0000000..b47dcfd Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/classes/com/example/dev_j200_2/repo/AppRepositoryI.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/META-INF/MANIFEST.MF b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8b1bfae --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Created-By: IntelliJ IDEA +Built-By: denis +Build-Jdk: 11.0.18 + diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/META-INF/persistence.xml b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/META-INF/persistence.xml new file mode 100644 index 0000000..f1b8d94 --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/META-INF/persistence.xml @@ -0,0 +1,9 @@ + + + + java:/test_db + + diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/HelloServlet.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/HelloServlet.class new file mode 100644 index 0000000..6cec251 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/HelloServlet.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/Passport.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/Passport.class new file mode 100644 index 0000000..95c2197 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/Passport.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/Person.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/Person.class new file mode 100644 index 0000000..fc8efe8 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/Person.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/PersonService.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/PersonService.class new file mode 100644 index 0000000..9ddae21 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/PersonService.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/PersonServiceImpl.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/PersonServiceImpl.class new file mode 100644 index 0000000..2c6a5cd Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/PersonServiceImpl.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/ServletInfo.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/ServletInfo.class new file mode 100644 index 0000000..0c3d47f Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/ServletInfo.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/ServletViewList.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/ServletViewList.class new file mode 100644 index 0000000..65ddf46 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/ServletViewList.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/User.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/User.class new file mode 100644 index 0000000..f8c6c72 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/User.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/UserStore.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/UserStore.class new file mode 100644 index 0000000..cf0f212 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/UserStore.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/DomainEntity.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/DomainEntity.class new file mode 100644 index 0000000..13c3070 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/DomainEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/PersonEntity.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/PersonEntity.class new file mode 100644 index 0000000..2a82d6c Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/PersonEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/UsersEntity.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/UsersEntity.class new file mode 100644 index 0000000..a0b2f15 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/entities/UsersEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepository.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepository.class new file mode 100644 index 0000000..eac5a53 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepository.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepositoryI.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepositoryI.class new file mode 100644 index 0000000..0469d9a Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepositoryI.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/web.xml b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/web.xml new file mode 100644 index 0000000..dbb4271 --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/WEB-INF/web.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/index.jsp b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/index.jsp new file mode 100644 index 0000000..cee00fb --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/index.jsp @@ -0,0 +1,20 @@ +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + JSP - Hello World + + +

<%= "Authorization" %> +

+
+Hello Servlet +
+
+

+
+

+ +
+ + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/same.html b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/same.html new file mode 100644 index 0000000..46c6335 --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT.war/same.html @@ -0,0 +1,27 @@ + + + + + Title + + +
+ + +
+ + + + + + + + + + + + + +
IDNAMESERIALNUMBER
+ + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/META-INF/MANIFEST.MF b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8b1bfae --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Created-By: IntelliJ IDEA +Built-By: denis +Build-Jdk: 11.0.18 + diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/META-INF/persistence.xml b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/META-INF/persistence.xml new file mode 100644 index 0000000..f1b8d94 --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/META-INF/persistence.xml @@ -0,0 +1,9 @@ + + + + java:/test_db + + diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/HelloServlet.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/HelloServlet.class new file mode 100644 index 0000000..6cec251 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/HelloServlet.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/Passport.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/Passport.class new file mode 100644 index 0000000..95c2197 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/Passport.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/Person.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/Person.class new file mode 100644 index 0000000..fc8efe8 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/Person.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/PersonService.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/PersonService.class new file mode 100644 index 0000000..9ddae21 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/PersonService.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/PersonServiceImpl.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/PersonServiceImpl.class new file mode 100644 index 0000000..2c6a5cd Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/PersonServiceImpl.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/ServletInfo.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/ServletInfo.class new file mode 100644 index 0000000..0c3d47f Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/ServletInfo.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/ServletViewList.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/ServletViewList.class new file mode 100644 index 0000000..65ddf46 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/ServletViewList.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/User.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/User.class new file mode 100644 index 0000000..f8c6c72 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/User.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/UserStore.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/UserStore.class new file mode 100644 index 0000000..cf0f212 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/UserStore.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/AbstractRest.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/AbstractRest.class new file mode 100644 index 0000000..abda17e Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/AbstractRest.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/AppConfig.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/AppConfig.class new file mode 100644 index 0000000..0a8d22b Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/AppConfig.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/DateAdapter.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/DateAdapter.class new file mode 100644 index 0000000..9ea9b62 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/DateAdapter.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/DomainRest.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/DomainRest.class new file mode 100644 index 0000000..ef122f0 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/DomainRest.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/PersonRest.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/PersonRest.class new file mode 100644 index 0000000..42509aa Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/PersonRest.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestConfig.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestConfig.class new file mode 100644 index 0000000..564ce89 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestConfig.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestDomainService.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestDomainService.class new file mode 100644 index 0000000..246ecee Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestDomainService.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestPersonService.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestPersonService.class new file mode 100644 index 0000000..e75754e Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/api/RestPersonService.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/DomainEntity.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/DomainEntity.class new file mode 100644 index 0000000..9e39363 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/DomainEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/PersonEntity.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/PersonEntity.class new file mode 100644 index 0000000..767cb96 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/PersonEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/UsersEntity.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/UsersEntity.class new file mode 100644 index 0000000..a0b2f15 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/entities/UsersEntity.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepository.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepository.class new file mode 100644 index 0000000..78795f4 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepository.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepositoryI.class b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepositoryI.class new file mode 100644 index 0000000..2ab9419 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/classes/com/example/dev_j200_2/repo/AppRepositoryI.class differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.activation-api-2.1.0.jar b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.activation-api-2.1.0.jar new file mode 100644 index 0000000..b125985 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.activation-api-2.1.0.jar differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.ws.rs-api-3.1.0.jar b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.ws.rs-api-3.1.0.jar new file mode 100644 index 0000000..80670a1 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.ws.rs-api-3.1.0.jar differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.xml.bind-api-4.0.0.jar b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.xml.bind-api-4.0.0.jar new file mode 100644 index 0000000..b10d606 Binary files /dev/null and b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/lib/jakarta.xml.bind-api-4.0.0.jar differ diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/web.xml b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/web.xml new file mode 100644 index 0000000..dbb4271 --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/WEB-INF/web.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/index.jsp b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/index.jsp new file mode 100644 index 0000000..cee00fb --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/index.jsp @@ -0,0 +1,20 @@ +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + JSP - Hello World + + +

<%= "Authorization" %> +

+
+Hello Servlet +
+
+

+
+

+ +
+ + \ No newline at end of file diff --git a/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/same.html b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/same.html new file mode 100644 index 0000000..46c6335 --- /dev/null +++ b/java/samples/rest/dev_j200_2/target/dev_j200_2-1.0-SNAPSHOT/same.html @@ -0,0 +1,27 @@ + + + + + Title + + +
+ + +
+ + + + + + + + + + + + + +
IDNAMESERIALNUMBER
+ + \ No newline at end of file