feat: add first simple jakartaee10-servlet project
jakarta project has to be cleaned up and some smaller errors have to be fixed
This commit is contained in:
parent
fe83dc1f33
commit
04ecd56598
8 changed files with 114 additions and 4 deletions
|
|
@ -32,7 +32,7 @@ var (
|
|||
func main() {
|
||||
config, err := config.LoadConfig()
|
||||
if err != nil {
|
||||
fmt.Printf("Error loading config: %v\n", err)
|
||||
fmt.Printf("error loading config: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ func main() {
|
|||
|
||||
err = logger.Init(config.LogFilePath, logLevel)
|
||||
if err != nil {
|
||||
fmt.Printf("Error initializing logger: %v\n", err)
|
||||
fmt.Printf("error initializing logger: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Todo App</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Todo App</h1>
|
||||
|
||||
<form method="post" action="todos">
|
||||
<label for="title">Title:</label>
|
||||
<input type="text" id="title" name="title" required />
|
||||
|
||||
<label for="completed">Completed:</label>
|
||||
<input type="checkbox" id="completed" name="completed" />
|
||||
|
||||
<button type="submit">Add Todo</button>
|
||||
</form>
|
||||
|
||||
<h2>Todos</h2>
|
||||
<ul>
|
||||
<%
|
||||
List<com.example.model.Todo> todos = (List<com.example.model.Todo>) request.getAttribute("todos");
|
||||
if (todos != null) {
|
||||
for (com.example.model.Todo todo : todos) {
|
||||
%>
|
||||
<li><%= todo.getTitle() %> - <%= todo.isCompleted() ? "Completed" : "Pending" %></li>
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue