Compare commits

...

5 commits
dev ... master

Author SHA1 Message Date
Imbus
4e47bdf32e Gitignore and cleaning 2024-02-08 15:11:59 +01:00
Imbus
37a41331c1 Sqlite instead of mysql for local use 2024-02-08 14:50:12 +01:00
Imbus
7a3ff989fb more ignore 2024-02-08 14:49:47 +01:00
Imbus
da20ce1a80 More unused 2024-02-08 14:38:39 +01:00
Imbus
6c8744d5aa Pruned unused stuff 2024-02-08 14:37:06 +01:00
42 changed files with 14 additions and 175 deletions

8
.gitignore vendored
View file

@ -2,6 +2,12 @@ target
tomcat.8080
tomcat.5000
# Gradle generated files
.gradle
app/build
app/bin
.settings
# IntelliJ Idea project files
.idea
*.iml
@ -24,4 +30,4 @@ buildNumber.properties
# JDT-specific (Eclipse Java Development Tools)
.classpath
.DS_Store
.DS_Store

Binary file not shown.

View file

@ -1,2 +0,0 @@
#Thu Feb 08 14:24:23 CET 2024
gradle.version=8.4

Binary file not shown.

View file

@ -1,13 +0,0 @@
#
#Thu Feb 08 14:14:29 CET 2024
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.source=21
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.sourceFile=generate

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,16 +0,0 @@
<%@ page import="model.HelloJspViewModel" %>
<html>
<body>
<h2>Hello Jsp, simple data from Servlet: <%=request.getAttribute("simple")%></h2>
<ol>
<%
HelloJspViewModel model = (HelloJspViewModel)request.getAttribute("complex");
for(int el : model.getData()) { %>
<li>
<%=el%>
<% out.print(":" + el); // or as ordinary java code %>
</li>
<% } %>
</ol>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/pure-min.css">
<title>the Book Store</title>
<style>
.main {
padding: 2em;
color: black;
}
</style>
</head>
<body>
<div class="main">
<h1>the Test Site</h1>
Welcome to this Fantastic Web Page.
<p> The following services are available today:
<ul>
<li> <a href = "http://localhost:8080/Survey"> THE SURVEY</a>
</ul>
</div>
</body>
</html>

Binary file not shown.

View file

@ -1,16 +0,0 @@
<%@ page import="model.HelloJspViewModel" %>
<html>
<body>
<h2>Hello Jsp, simple data from Servlet: <%=request.getAttribute("simple")%></h2>
<ol>
<%
HelloJspViewModel model = (HelloJspViewModel)request.getAttribute("complex");
for(int el : model.getData()) { %>
<li>
<%=el%>
<% out.print(":" + el); // or as ordinary java code %>
</li>
<% } %>
</ol>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/pure-min.css">
<title>the Book Store</title>
<style>
.main {
padding: 2em;
color: black;
}
</style>
</head>
<body>
<div class="main">
<h1>the Test Site</h1>
Welcome to this Fantastic Web Page.
<p> The following services are available today:
<ul>
<li> <a href = "http://localhost:8080/Survey"> THE SURVEY</a>
</ul>
</div>
</body>
</html>

View file

@ -1,14 +0,0 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package etsf20;
public class App {
public String getGreeting() {
return "Hello World!";
}
public static void main(String[] args) {
System.out.println(new App().getGreeting());
}
}

View file

@ -6,29 +6,16 @@ import java.sql.*;
*/
public class Database implements AutoCloseable {
// If you have the mysql server on your own computer use "localhost" as server address.
private static String databaseServerAddress = "vm26.cs.lth.se";
private static String databaseUser = "<your databse user on vm26>"; // database login user
private static String databasePassword = "<your password>"; // database login password
private static String database = "<your database, normally the same as database user>"; // the database to use, i.e. default schema
// The connection to the database
private Connection conn = null;
public Database() {
try{
conn = DriverManager.getConnection("jdbc:mysql://" + databaseServerAddress + "/" +
database, databaseUser, databasePassword);
// Display the contents of the database in the console.
// This should be removed in the final version
try(Statement stmt = conn.createStatement()) {
ResultSet rs = stmt.executeQuery("select * from Respondents");
while (rs.next()) {
String name = rs.getString("name");
System.out.println(name);
}
}
} catch (SQLException e) {
// Connect to sqlite
try {
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:database.db");
System.out.println("Opened database successfully");
} catch (Exception e) {
throw new RuntimeException(e);
}
}

View file

@ -1,17 +0,0 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package etsf20;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Disabled;
class AppTest {
@Disabled
@Test void appHasAGreeting() {
App classUnderTest = new App();
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
}
}