---
# System prepended metadata

title: Java Debugging
tags: [Java, Debugging]

---

###### tags: `Java` `Debugging`

# Java Debugging
## Helpful Print Statements
- To make testing variables stand out
    ```java!
    System.out.println("=".repeat(20));
    System.out.printf("\n\tVARIABLES:\t  <VAR_TYPE> \n\n"); // Add: ,<VAR_NAME> before )
    System.out.println("=".repeat(20));
    ```
    Help with printf: [Java Starter notes](/VzARqjb1TzadDcPGhJAesA)

## Errors
### Setup
- My .jsp file is not launching:
    - Try Updating Maven for your project. (Right-click on the project, hover over Maven, then select Update Project). This can be tried with Force Update selected and unselected.
    ![](https://i.imgur.com/8qiyFBs.png)
    
### Forms
- Yellow wording on form AND/OR submit button not working.
    ![](https://i.imgur.com/tP8Wxt4.png)
    - Make sure you have the following at the top of your jsp file.
        ```!
        <!-- for forms -->
        <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
        <%@ taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt" %>
        <!-- for validation -->
        <%@ page isErrorPage="true" %>
        ```
    - Make sure you have the following in **src/main/resources/** *application.properties*
    `  spring.mvc.hiddenmethod.filter.enabled=true
    `
- When doing an edit, recieved 'PUT' not supported.
    ![](https://i.imgur.com/PZZKARp.png)
    - Double check your action path in the form. For me, it was going to my getMapping not my putMapping.

### Red Underlines
- @ Parameters underlined
    ![](https://i.imgur.com/tgxqqY7.png)
    - Try Ctrl + Shift + o
- import names are underlined
    ![](https://i.imgur.com/AeRTZK1.png)
    - Check to make sure you have all the 
### Whitelabel Error Page
- Bean property is not readable
![](https://i.imgur.com/Ry0R9fr.png)
    - make sure to check your getter and setter for the listed attribute. It doesn't hurt to delete and redue the getter and setter for that attribute.
