From aab20c1c484989208760c5582b714c248e4205b0 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Fri, 5 Apr 2019 13:13:17 +0200 Subject: [PATCH 1/4] + Creating Database connection + POJOs for: - Address - Author - Book - Category - Customer - Publisher Signed-off-by: Johannes Theiner --- .gitignore | 3 +- config.json.example | 9 ++++ .../de/hsel/itech/config/Configuration.java | 39 +++++++++++++++++ .../java/de/hsel/itech/config/Database.java | 23 ++++++++++ src/main/java/de/hsel/itech/db/Database.java | 42 +++++++++++++++++++ .../java/de/hsel/itech/db/pojo/Address.java | 23 ++++++++++ .../java/de/hsel/itech/db/pojo/Author.java | 19 +++++++++ src/main/java/de/hsel/itech/db/pojo/Book.java | 34 +++++++++++++++ .../java/de/hsel/itech/db/pojo/Category.java | 19 +++++++++ .../java/de/hsel/itech/db/pojo/Customer.java | 21 ++++++++++ .../java/de/hsel/itech/db/pojo/Publisher.java | 18 ++++++++ 11 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 config.json.example create mode 100644 src/main/java/de/hsel/itech/config/Configuration.java create mode 100644 src/main/java/de/hsel/itech/config/Database.java create mode 100644 src/main/java/de/hsel/itech/db/Database.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/Address.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/Author.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/Book.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/Category.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/Customer.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/Publisher.java diff --git a/.gitignore b/.gitignore index 358487f..881f473 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.iml /target -.idea \ No newline at end of file +.idea +config.json diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..90f45b2 --- /dev/null +++ b/config.json.example @@ -0,0 +1,9 @@ +{ + "database": { + "hostname": "localhost", + "port": 3306, + "database": "itech", + "username": "itech", + "password": "123456" + } +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/config/Configuration.java b/src/main/java/de/hsel/itech/config/Configuration.java new file mode 100644 index 0000000..2f6f02e --- /dev/null +++ b/src/main/java/de/hsel/itech/config/Configuration.java @@ -0,0 +1,39 @@ +package de.hsel.itech.config; + +import com.google.gson.Gson; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Getter +@ToString +@EqualsAndHashCode +public class Configuration { + + private Database database; + + + public static Configuration get(String fileName) { + Gson gson = new Gson(); + + FileReader reader = null; + try { + reader = new FileReader(new File(fileName)); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + assert reader != null; + return gson.fromJson(reader, Configuration.class); + } + +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/config/Database.java b/src/main/java/de/hsel/itech/config/Database.java new file mode 100644 index 0000000..2e78599 --- /dev/null +++ b/src/main/java/de/hsel/itech/config/Database.java @@ -0,0 +1,23 @@ +package de.hsel.itech.config; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Getter +@ToString +@EqualsAndHashCode +public class Database { + + String hostname; + int port; + String database; + String username; + String password; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/Database.java b/src/main/java/de/hsel/itech/db/Database.java new file mode 100644 index 0000000..c42d288 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/Database.java @@ -0,0 +1,42 @@ +package de.hsel.itech.db; + +import de.hsel.itech.config.Configuration; +import org.jetbrains.annotations.Nullable; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ +public class Database { + + public Database() { + try { + Class.forName("com.mariadb.jdbc.Driver"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + + } + + @Nullable + private Connection getConnection() { + Configuration config = Configuration.get("config.json"); + try { + return DriverManager.getConnection("jdbc:mariadb://" + config.getDatabase().getHostname() + ":" + config.getDatabase().getPort() + "/" + config.getDatabase().getDatabase(), config.getDatabase().getUsername(), config.getDatabase().getPassword()); + + } catch (SQLException e) { + e.printStackTrace(); + } + return null; + } + + + + + +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/Address.java b/src/main/java/de/hsel/itech/db/pojo/Address.java new file mode 100644 index 0000000..f986fbf --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/Address.java @@ -0,0 +1,23 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Data +@AllArgsConstructor +public class Address { + + private Customer customer; + private long id; + private String name; + private String street; + private String number; + private int zipCode; + private String city; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/Author.java b/src/main/java/de/hsel/itech/db/pojo/Author.java new file mode 100644 index 0000000..507893e --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/Author.java @@ -0,0 +1,19 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Data +@AllArgsConstructor +public class Author { + + private long id; + private String name; + +} diff --git a/src/main/java/de/hsel/itech/db/pojo/Book.java b/src/main/java/de/hsel/itech/db/pojo/Book.java new file mode 100644 index 0000000..79160e1 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/Book.java @@ -0,0 +1,34 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.time.Year; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Data +@AllArgsConstructor +public class Book { + + private int isbn; + private Author author; + private Publisher publisher; + private Category category; + private String title; + private Year year; + + /** + * saved in cents + */ + private int price; + private String description; + private String image; + + + +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/Category.java b/src/main/java/de/hsel/itech/db/pojo/Category.java new file mode 100644 index 0000000..685ca42 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/Category.java @@ -0,0 +1,19 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Data +@AllArgsConstructor +public class Category { + + private int id; + private String name; + private String image; +} diff --git a/src/main/java/de/hsel/itech/db/pojo/Customer.java b/src/main/java/de/hsel/itech/db/pojo/Customer.java new file mode 100644 index 0000000..b06ab30 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/Customer.java @@ -0,0 +1,21 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Data +@AllArgsConstructor +public class Customer { + + private long id; + private String email; + private String name; + private String password; + private boolean admin; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/Publisher.java b/src/main/java/de/hsel/itech/db/pojo/Publisher.java new file mode 100644 index 0000000..c036d86 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/Publisher.java @@ -0,0 +1,18 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + */ + +@Data +@AllArgsConstructor +public class Publisher { + + private long id; + private String name; +} \ No newline at end of file From 7495f455e283dcce414af248c2acefce0d72e6cc Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Fri, 5 Apr 2019 19:54:03 +0200 Subject: [PATCH 2/4] ~ POJOs done + Example Database Servlet Signed-off-by: Johannes Theiner --- pom.xml | 1 + src/main/java/de/hsel/itech/db/Database.java | 31 ++++++++++---- .../hsel/itech/db/pojo/CreditCardPayment.java | 24 +++++++++++ .../hsel/itech/db/pojo/DebitCardPayment.java | 21 ++++++++++ .../de/hsel/itech/db/pojo/InvoicePayment.java | 18 +++++++++ .../java/de/hsel/itech/db/pojo/Order.java | 29 ++++++++++++++ .../de/hsel/itech/db/pojo/PayPalPayment.java | 20 ++++++++++ .../de/hsel/itech/db/pojo/PaymentType.java | 18 +++++++++ .../de/hsel/itech/db/pojo/ShoppingCart.java | 20 ++++++++++ .../java/de/hsel/itech/servlet/Database.java | 40 +++++++++++++++++++ src/main/webapp/WEB-INF/web.xml | 10 +++++ 11 files changed, 224 insertions(+), 8 deletions(-) create mode 100644 src/main/java/de/hsel/itech/db/pojo/CreditCardPayment.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/DebitCardPayment.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/InvoicePayment.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/Order.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/PayPalPayment.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/PaymentType.java create mode 100644 src/main/java/de/hsel/itech/db/pojo/ShoppingCart.java create mode 100644 src/main/java/de/hsel/itech/servlet/Database.java diff --git a/pom.xml b/pom.xml index 5821b30..2418572 100644 --- a/pom.xml +++ b/pom.xml @@ -137,6 +137,7 @@ 100 ${project.build.sourceEncoding} true + false diff --git a/src/main/java/de/hsel/itech/db/Database.java b/src/main/java/de/hsel/itech/db/Database.java index c42d288..44faa36 100644 --- a/src/main/java/de/hsel/itech/db/Database.java +++ b/src/main/java/de/hsel/itech/db/Database.java @@ -3,11 +3,11 @@ package de.hsel.itech.db; import de.hsel.itech.config.Configuration; import org.jetbrains.annotations.Nullable; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; +import java.sql.*; /** + * + * * @author Johannes Theiner * @version 0.1 * @since 0.1 @@ -15,11 +15,6 @@ import java.sql.SQLException; public class Database { public Database() { - try { - Class.forName("com.mariadb.jdbc.Driver"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } } @@ -35,6 +30,26 @@ public class Database { return null; } + public String getHello() { + Connection connection = getConnection(); + + String hello = ""; + try { + PreparedStatement statement = connection.prepareStatement("SELECT * FROM test WHERE id = 1"); + + ResultSet resultSet = statement.executeQuery(); + resultSet.next(); + hello = resultSet.getString("hello"); + + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + + return hello; + + } + diff --git a/src/main/java/de/hsel/itech/db/pojo/CreditCardPayment.java b/src/main/java/de/hsel/itech/db/pojo/CreditCardPayment.java new file mode 100644 index 0000000..0a19e81 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/CreditCardPayment.java @@ -0,0 +1,24 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.time.LocalDate; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ + +@Data +@AllArgsConstructor +public class CreditCardPayment { + + private long id; + private Customer customer; + private int number; + private String owner; + private LocalDate expiration; + private int checksum; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/DebitCardPayment.java b/src/main/java/de/hsel/itech/db/pojo/DebitCardPayment.java new file mode 100644 index 0000000..3741404 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/DebitCardPayment.java @@ -0,0 +1,21 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ + +@Data +@AllArgsConstructor +public class DebitCardPayment { + + private long id; + private Customer customer; + private String iban; + private String bic; + private String owner; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/InvoicePayment.java b/src/main/java/de/hsel/itech/db/pojo/InvoicePayment.java new file mode 100644 index 0000000..acf8a5a --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/InvoicePayment.java @@ -0,0 +1,18 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ + +@Data +@AllArgsConstructor +public class InvoicePayment { + + private long id; + private Customer customer; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/Order.java b/src/main/java/de/hsel/itech/db/pojo/Order.java new file mode 100644 index 0000000..c0f8a14 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/Order.java @@ -0,0 +1,29 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.time.LocalDateTime; + + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ + +@Data +@AllArgsConstructor +public class Order { + + private long id; + private LocalDateTime date; + private Book book; + + /** + * price in cents + */ + private int price; + private PaymentType paymentType; + private Address address; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/PayPalPayment.java b/src/main/java/de/hsel/itech/db/pojo/PayPalPayment.java new file mode 100644 index 0000000..e5804ac --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/PayPalPayment.java @@ -0,0 +1,20 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ + +@Data +@AllArgsConstructor +public class PayPalPayment { + + private long id; + private Customer customer; + private String email; + private String authCode; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/PaymentType.java b/src/main/java/de/hsel/itech/db/pojo/PaymentType.java new file mode 100644 index 0000000..5f7e519 --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/PaymentType.java @@ -0,0 +1,18 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ + +@Data +@AllArgsConstructor +public class PaymentType { + + private long id; + private String name; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/db/pojo/ShoppingCart.java b/src/main/java/de/hsel/itech/db/pojo/ShoppingCart.java new file mode 100644 index 0000000..375d01a --- /dev/null +++ b/src/main/java/de/hsel/itech/db/pojo/ShoppingCart.java @@ -0,0 +1,20 @@ +package de.hsel.itech.db.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ + +@Data +@AllArgsConstructor +public class ShoppingCart { + + private long id; + private Customer customer; + private Book article; + private int count; +} \ No newline at end of file diff --git a/src/main/java/de/hsel/itech/servlet/Database.java b/src/main/java/de/hsel/itech/servlet/Database.java new file mode 100644 index 0000000..7855d1f --- /dev/null +++ b/src/main/java/de/hsel/itech/servlet/Database.java @@ -0,0 +1,40 @@ +package de.hsel.itech.servlet; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Johannes Theiner + * @version 0.1 + * @since 0.1 + **/ +public class Database extends HttpServlet { + + private static final long serialVersionUID = 15679036734L; + + /** + * doGet. + * + * @param req Request + * @param resp Response + * @throws IOException failed + */ + @Override + protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) + throws IOException { + + resp.setContentType("text/html"); + final PrintWriter out = resp.getWriter(); + out.println(""); + out.println(""); + out.println("Hallo Welt!"); + out.println(""); + out.println(""); + out.println("

" + new de.hsel.itech.db.Database().getHello() + "

"); + out.println(""); + out.println(""); + } +} \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 7f3e851..45371a9 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -10,8 +10,18 @@ de.hsel.itech.HelloWorld + + database + de.hsel.itech.servlet.Database + + helloWorld /index + + + database + /db + \ No newline at end of file From 49287ee2e4a0140466acf8ec0a0a83d5aef5834d Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Mon, 8 Apr 2019 18:30:46 +0200 Subject: [PATCH 3/4] ~ moved HelloWorld Servlet ~ asserted connection to database Signed-off-by: Johannes Theiner --- src/main/java/de/hsel/itech/db/Database.java | 2 +- src/main/java/de/hsel/itech/{ => servlet}/HelloWorld.java | 2 +- src/main/webapp/WEB-INF/web.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/main/java/de/hsel/itech/{ => servlet}/HelloWorld.java (97%) diff --git a/src/main/java/de/hsel/itech/db/Database.java b/src/main/java/de/hsel/itech/db/Database.java index 44faa36..175c1a0 100644 --- a/src/main/java/de/hsel/itech/db/Database.java +++ b/src/main/java/de/hsel/itech/db/Database.java @@ -35,8 +35,8 @@ public class Database { String hello = ""; try { + assert connection != null; PreparedStatement statement = connection.prepareStatement("SELECT * FROM test WHERE id = 1"); - ResultSet resultSet = statement.executeQuery(); resultSet.next(); hello = resultSet.getString("hello"); diff --git a/src/main/java/de/hsel/itech/HelloWorld.java b/src/main/java/de/hsel/itech/servlet/HelloWorld.java similarity index 97% rename from src/main/java/de/hsel/itech/HelloWorld.java rename to src/main/java/de/hsel/itech/servlet/HelloWorld.java index 0d49078..b22757d 100644 --- a/src/main/java/de/hsel/itech/HelloWorld.java +++ b/src/main/java/de/hsel/itech/servlet/HelloWorld.java @@ -1,4 +1,4 @@ -package de.hsel.itech; +package de.hsel.itech.servlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 45371a9..391a545 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -7,7 +7,7 @@ helloWorld - de.hsel.itech.HelloWorld + de.hsel.itech.servlet.HelloWorld From 4b6510d23041d390d8503e6c91055c5d9b1a79f5 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Tue, 9 Apr 2019 12:46:21 +0200 Subject: [PATCH 4/4] ~ changed helloWorld to find absolute path to config files Signed-off-by: Johannes Theiner --- src/main/java/de/hsel/itech/config/Configuration.java | 9 ++++++--- src/main/java/de/hsel/itech/db/Database.java | 2 +- src/main/java/de/hsel/itech/servlet/HelloWorld.java | 6 +++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/hsel/itech/config/Configuration.java b/src/main/java/de/hsel/itech/config/Configuration.java index 2f6f02e..3c2b440 100644 --- a/src/main/java/de/hsel/itech/config/Configuration.java +++ b/src/main/java/de/hsel/itech/config/Configuration.java @@ -15,20 +15,23 @@ import java.io.FileReader; * @since 0.1 */ -@Getter @ToString @EqualsAndHashCode public class Configuration { + private static final String filename = "config.json"; + + @Getter private Database database; - public static Configuration get(String fileName) { + + public static Configuration get() { Gson gson = new Gson(); FileReader reader = null; try { - reader = new FileReader(new File(fileName)); + reader = new FileReader(new File(filename)); } catch (FileNotFoundException e) { e.printStackTrace(); } diff --git a/src/main/java/de/hsel/itech/db/Database.java b/src/main/java/de/hsel/itech/db/Database.java index 175c1a0..f624cb6 100644 --- a/src/main/java/de/hsel/itech/db/Database.java +++ b/src/main/java/de/hsel/itech/db/Database.java @@ -20,7 +20,7 @@ public class Database { @Nullable private Connection getConnection() { - Configuration config = Configuration.get("config.json"); + Configuration config = Configuration.get(); try { return DriverManager.getConnection("jdbc:mariadb://" + config.getDatabase().getHostname() + ":" + config.getDatabase().getPort() + "/" + config.getDatabase().getDatabase(), config.getDatabase().getUsername(), config.getDatabase().getPassword()); diff --git a/src/main/java/de/hsel/itech/servlet/HelloWorld.java b/src/main/java/de/hsel/itech/servlet/HelloWorld.java index b22757d..9aa5a44 100644 --- a/src/main/java/de/hsel/itech/servlet/HelloWorld.java +++ b/src/main/java/de/hsel/itech/servlet/HelloWorld.java @@ -3,6 +3,7 @@ package de.hsel.itech.servlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.File; import java.io.IOException; import java.io.PrintWriter; @@ -30,12 +31,15 @@ public class HelloWorld extends HttpServlet { resp.setContentType("text/html"); final PrintWriter out = resp.getWriter(); + out.println(""); out.println(""); out.println(""); out.println("Hallo Welt!"); out.println(""); out.println(""); - out.println("

Hallo Ostfriesland!

"); + out.println("

Hallo Ostfriesland!


"); + out.println("

" + System.getProperty("catalina.base") + "


"); + out.println("

" + new File("").getAbsolutePath() + "

"); out.println(""); out.println(""); }