Having trouble navigating to other pages in html:
TransactionController.java:
package com.weathGuardian.controller;

import com.weathGuardian.models.Transaction;
import com.weathGuardian.models.User;
import com.weathGuardian.Service.TransactionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/dashboard")
public class TransactionController {

    private final TransactionService transactionService;

    @Autowired
    public TransactionController(TransactionService transactionService) {
        this.transactionService = transactionService;
    }

    @GetMapping
    public String dashboard(Model model) {
        // Simulate current user data and transactions
        User currentUser = getCurrentUser(); // Replace with actual logic to get current user

        List<Transaction> transactions = transactionService.getAllTransactions();
        // Example methods to calculate budget status and remaining budget
        String budgetStatus = calculateBudgetStatus();
        String remainingBudget = calculateRemainingBudget();
        // Example method to get savings goals
        List<SavingsGoal> savingsGoals = getSavingsGoals();

        // Add attributes to model
        model.addAttribute("currentUser", currentUser);
        model.addAttribute("transactions", transactions);
        model.addAttribute("budgetStatus", budgetStatus);
        model.addAttribute("remainingBudget", remainingBudget);
        model.addAttribute("savingsGoals", savingsGoals);

        return "dashboard"; // This corresponds to dashboard.html in templates directory
    }
    @GetMapping("/transaction-history")
    public String transactionHistory(Model model) {
        // Populate model attributes (transactions, etc.
        User currentUser = getCurrentUser();
        List<Transaction> transactions = transactionService.getAllTransactions();
        String budgetStatus = calculateBudgetStatus();
        String remainingBudget = calculateRemainingBudget();
        List<SavingsGoal> savingsGoals = getSavingsGoals();
        model.addAttribute("currentUser", currentUser);
        model.addAttribute("dashboard", dashboard(model));
        model.addAttribute("budgetStatus", budgetStatus);
        model.addAttribute("remainingBudget", remainingBudget);
        model.addAttribute("savingsGoals", savingsGoals);
        return "transaction-history"; // Corresponds to transaction-history.html in templates directory
    }
    // Example method to get current user (replace with actual logic)
    private User getCurrentUser() {
        // Implement logic to fetch current user from authentication context or database
        // return userRepository.findByUsername(username);
        return new User(); // Example return
    }

    // Example methods to calculate budget status and remaining budget
    private String calculateBudgetStatus() {
        // Implement  logic to calculate budget status
        return "Good"; // Example return
    }

    private String calculateRemainingBudget() {
        // Implement logic to calculate remaining budget
        return "$1000"; // Example return
    }

    // Example method to get savings goals
    private List<SavingsGoal> getSavingsGoals() {
        // Implement your logic to fetch savings goals from database or provide mock data
        List<SavingsGoal> goals = new ArrayList<>();
        goals.add(new SavingsGoal("Goal 1", 500));
        goals.add(new SavingsGoal("Goal 2", 1000));
        return goals;
    }

    // Static inner class for mock savings goal (adjust as per your actual SavingsGoal class)
    private static class SavingsGoal {
        private String goalName;
        private double amount;

        public SavingsGoal(String goalName, double amount) {
            this.goalName = goalName;
            this.amount = amount;
        }

        public String getGoalName() {
            return goalName;
        }

        public void setGoalName(String goalName) {
            this.goalName = goalName;
        }

        public double getAmount() {
            return amount;
        }

        public void setAmount(double amount) {
            this.amount = amount;
        }
    }
}dashboard.java:
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WealthGuardian Dashboard</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="styles.css"> <!-- Your custom styles file -->
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="#">WealthGuardian</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
            aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" th:href="@{/dashboard}">Dashboard</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/transaction-history}">Transaction History</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/budget-management}">Budget Management</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/investments-tracker}">Investments Tracker</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/savings-goals}">Savings Goals</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/debt-overview}">Debt Overview</a>
            </li>
        </ul>
    </div>
</nav>

<div class="container mt-5">
    <div class="row">
        <div class="col-md-8">
            <h1>Welcome to your Dashboard</h1>
            <p>Here you can see a quick overview of your financial health.</p>
        </div>
        <div class="col-md-4">
            <div class="card">
                <div class="card-header">
                    Account Information
                </div>
                <div class="card-body">
                    <h5 class="card-title" th:text="${currentUser.account.accountName}"></h5>
                    <p class="card-text" th:text="${currentUser.account.accountType}"></p>
                    <p class="card-text" th:text="${currentUser.account.balance}"></p>
                </div>
            </div>
        </div>
    </div>

    <div class="row mt-4">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    Recent Transactions
                </div>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item" th:each="transaction : ${transactions}">
                        <span th:text="${#dates.format(transaction.date, 'yyyy-MM-dd')}"></span> -
                        <span th:text="${transaction.type}"></span> -
                        <span th:text="${transaction.amount}"></span>
                    </li>
                </ul>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    Budget Overview
                </div>
                <div class="card-body">
                    <h5 class="card-title">Monthly Budget</h5>
                    <p class="card-text">Your budget status: <span th:text="${budgetStatus}"></span></p>
                    <p class="card-text">Remaining budget: <span th:text="${remainingBudget}"></span></p>
                    <a th:href="@{/budget-management}" class="btn btn-primary">Go to Budget Management</a>
                </div>
            </div>
        </div>
    </div>

    <div class="row mt-4">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    Savings Goals
                </div>
                <div class="card-body">
                    <h5 class="card-title">Your Savings Goals</h5>
                    <ul class="list-group">
                        <li class="list-group-item" th:each="goal : ${savingsGoals}">
                            Goal: <span th:text="${goal.goalName}"></span> -
                            Amount: <span th:text="${goal.amount}"></span>
                        </li>
                    </ul>
                    <a th:href="@{/savings-goals}" class="btn btn-primary mt-2">Go to Savings Goals</a>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="theme-switch-wrapper">
    <label class="theme-switch" for="checkbox">
        <input type="checkbox" id="checkbox" />
        <div class="slider round"></div>
    </label>
    <em>Enable Dark Mode!</em>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="script.js"></script> <!-- Your JavaScript file -->
</body>

</html>
transaction-history.java:
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WealthGuardian - Transaction History</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/styles.css"> <!-- Your custom styles file -->
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="#">WealthGuardian</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
            aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" th:href="@{/dashboard}">Dashboard</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/transaction-history}">Transaction History</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/budget-management}">Budget Management</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/investments-tracker}">Investments Tracker</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/savings-goals}">Savings Goals</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/debt-overview}">Debt Overview</a>
            </li>
        </ul>
    </div>
</nav>

<div class="container mt-5">
    <h1>Transaction History</h1>

    <table class="table table-striped">
        <thead>
        <tr>
            <th>Date</th>
            <th>Type</th>
            <th>Amount</th>
            <th>Description</th>
        </tr>
        </thead>
        <tbody>
        <!-- Iterate over transaction data -->
        <tr th:each="transaction : ${transactions}">
            <td th:text="${#dates.format(transaction.date, 'yyyy-MM-dd')}"></td>
            <td th:text="${transaction.type}"></td>
            <td th:text="${transaction.amount}"></td>
            <td th:text="${transaction.description}"></td>
        </tr>

        <!-- Example row if no transactions -->
        <tr th:if="${transactions.isEmpty()}">
            <td colspan="4" class="text-center">No transactions found.</td>
        </tr>
        </tbody>
    </table>
</div>

<div class="theme-switch-wrapper">
    <label class="theme-switch" for="checkbox">
        <input type="checkbox" id="checkbox" />
        <div class="slider round"></div>
    </label>
    <em>Enable Dark Mode!</em>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="script.js"></script> <!-- Your JavaScript file -->
</body>

</html>