Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
|
4e47bdf32e | ||
|
37a41331c1 | ||
|
7a3ff989fb | ||
|
da20ce1a80 | ||
|
6c8744d5aa |
42 changed files with 14 additions and 175 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -2,6 +2,12 @@ target
|
||||||
tomcat.8080
|
tomcat.8080
|
||||||
tomcat.5000
|
tomcat.5000
|
||||||
|
|
||||||
|
# Gradle generated files
|
||||||
|
.gradle
|
||||||
|
app/build
|
||||||
|
app/bin
|
||||||
|
.settings
|
||||||
|
|
||||||
# IntelliJ Idea project files
|
# IntelliJ Idea project files
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
@ -24,4 +30,4 @@ buildNumber.properties
|
||||||
# JDT-specific (Eclipse Java Development Tools)
|
# JDT-specific (Eclipse Java Development Tools)
|
||||||
.classpath
|
.classpath
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
#Thu Feb 08 14:24:23 CET 2024
|
|
||||||
gradle.version=8.4
|
|
Binary file not shown.
Binary file not shown.
|
@ -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.
Binary file not shown.
Binary file not shown.
|
@ -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>
|
|
11
app/bin/main/webapp/static/css/pure-min.css
vendored
11
app/bin/main/webapp/static/css/pure-min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
@ -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.
|
@ -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());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,29 +6,16 @@ import java.sql.*;
|
||||||
*/
|
*/
|
||||||
public class Database implements AutoCloseable {
|
public class Database implements AutoCloseable {
|
||||||
|
|
||||||
// If you have the mysql server on your own computer use "localhost" as server address.
|
// The connection to the database
|
||||||
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
|
|
||||||
private Connection conn = null;
|
private Connection conn = null;
|
||||||
|
|
||||||
public Database() {
|
public Database() {
|
||||||
try{
|
// Connect to sqlite
|
||||||
conn = DriverManager.getConnection("jdbc:mysql://" + databaseServerAddress + "/" +
|
try {
|
||||||
database, databaseUser, databasePassword);
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
conn = DriverManager.getConnection("jdbc:sqlite:database.db");
|
||||||
// Display the contents of the database in the console.
|
System.out.println("Opened database successfully");
|
||||||
// This should be removed in the final version
|
} catch (Exception e) {
|
||||||
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) {
|
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue