Learn two common approaches for iterating over a Map and display its content in the UI.
Also find me here:
Baeldung Author
Kai Yuan
Kai Yuan has been a software developer for over 15 years. He builds enterprise Java applications in work. He has 20 years experience of Linux and is a big fan of the Vim editor. He is happy to help people at stackoverflow.com. He lives currently in Hamburg.
Here's what I've written (so far):
Baeldung on Java
- All
- Java String (41)
- Java List (25)
- Java Array (18)
- Core Java (18)
- Java Numbers (16)
- Java Map (15)
- Java IO (13)
- Java (11)
- Algorithms (9)
- Java Streams (8)
- Testing (7)
- Java Collections (5)
- Persistence (4)
- Maven (4)
- Spring Boot (2)
- Java Concurrency (2)
- XML (1)
- Spring Persistence (1)
- Networking (1)
- Java Web (1)
- Jakarta EE (1)
- Jackson (1)
- IDE (1)
Executing SQL Scripts in H2 Database
Filed under Persistence
Walk through the common ways we can execute SQL scripts using H2 in a Spring Boot test environment.
Using Sequences in the H2 Database
Filed under Persistence
Explore how to use sequence numbers in the H2 database and learn how setting H2’s compatibility mode can make tests more realistic and less likely to break
Resolving Spring JDBC “IncorrectResultSetColumnCountException: Incorrect column count”
Filed under Spring Persistence
Explore what causes Spring JDBC’s IncorrectResultSetColumnCountException, how to use queryForList() correctly, and how to map the query result to a custom class.
Call Java Class in JSP
Filed under Java Web
Explore two ways to call a Java class in JSP, from basic scriptlets to more structured approaches using jsp:useBean.
Get the Index Values From forEach Loop in JSTL
Filed under Jakarta EE
Learn about how to iterate using a forEach loop when using JSTL and accessing the current iteration index value.
List Matchers with Generics in Mockito
Filed under Testing
Learn about how to stub methods that accept generic List parameters using Mockito.
What Is the Difference Between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS?
Filed under Core Java
Learn about how to use JDK_JAVA_OPTIONS or JAVA_TOOL_OPTIONS to provide JVM options to java commands using an environment variable.
Resolving ClassCastException: Ljava.lang.Object; cannot be cast to Ljava.lang.Integer
Filed under Core Java
Explore why the ClassCastException is raised when casting Object[] to Integer[] in Java.
Baeldung on Linux
- All
- Scripting (36)
- Files (32)
- File Editing (21)
- Text Processing (11)
- File Searching (11)
- Processes (10)
- Administration (10)
- Filesystems (6)
- File Viewing (6)
- User Administration (4)
- Search (3)
- File Permissions (3)
- Web (2)
- Security (1)
- File Compression (1)
- Boot Process (1)
How to Limit grep Context to “n” Characters in a Line
Filed under File Searching
Learn how to limit the grep output characters displayed before and after the match.
Guide to Linux dirname Command with Examples
Learn how to use the dirname command in Linux to extract the directory part of a given path.
Guide to Linux basename Command with Examples
Learn about how to use the basename command to determine the file or folder name for one or more paths.
Printing Quote Characters in AWK
Filed under Text Processing
Learn how to print single or double quote characters in AWK scripts.
How to Read the First and the Last Line From Input
Filed under File Viewing
Learn how to extract the first and last lines from an input file using a single command.
Printing Specified Lines From a File
Filed under File Viewing
Learn how to extract specific lines from a file by line numbers using sed and awk.
Replace the First n Matched Instances in a File
Filed under File Editing
Learn how to replace the first n pattern occurrences in a file using sed and awk.
How to Operate on Files Listed in a File
Learn to use various techniques to operate on files listed in a file.
What’s the Meaning of $! in Bash Scripting
Learn the meaning of the special shell variable $!.
Baeldung on Kotlin
- All
- Kotlin Collections (18)
- Kotlin Classes and Objects (10)
- Kotlin Basics (10)
- Kotlin Numbers (9)
- Kotlin Strings (7)
- Kotlin Functions (5)
- Kotlin (4)
- Kotlin Arrays (3)
- Testing (2)
- Functional Programming (2)
- Spring (1)
- Security (1)
- Libraries (1)
- Algorithms (1)
Resolving Compile Error: “Const ‘val’ is only allowed on top level, in named objects, or in companion objects” in Kotlin
Filed under Kotlin Classes and Objects
Learn where and how you can use const val in Kotlin.
Resolving “Type Mismatch Inferred Type is Unit But Void Was Expected” in Kotlin
Filed under Kotlin Functions
Learn how to solve the “Unit but Void was expected” compilation error in Kotlin.
Iterating Enum Entries in Kotlin
Filed under Kotlin Basics
Learn how to loop over the entries of an Enum in Kotlin.
Difference Between clearAllMocks() and unmockkAll() in MockK
Filed under Testing
Learn about the difference between clearAllMocks() and unmockkAll() in MockK and when to use each one.
Serialize Enum Property to JSON in Kotlin
Filed under Libraries
Learn how to serialize a Kotlin enum property to JSON using Kotlin libraries.
Finding First Match in Nested Lists in Kotlin
Filed under Algorithms, Kotlin Collections
Learn how to search through a list of lists in Kotlin to find the first matching element.
Conditional Exception Throwing in Kotlin
Filed under Kotlin
Learn different approaches to throwing an exception when a condition is true in Kotlin.
Pass a Function as Parameter to Another in Kotlin
Filed under Kotlin Functions
Learn about how functions can be passed as parameters to other functions in Kotlin.
Matching Varargs Using MockK in Kotlin
Filed under Testing
Learn how to use the MockK mocking library to match varargs arguments in Kotlin.
Baeldung on Ops
- All
- Git (5)
Remove File From Git Repository Without Deleting It Locally
Filed under Git
Learn how to remove a file or directory from a Git repository but keep its local copy
How to Get the Current Branch Name in Git
Filed under Git
Learn how to get the Git branch name we’re currently working on
Delete a Git Branch Locally and Remotely
Filed under Git
Learn how to delete Git branches
Move Existing, Uncommitted Work to a New Branch in Git
Filed under Git
Learn a couple of quick ways to move uncommitted changes to a new Git branch
Squash the Last X Commits Using Git
Filed under Git
Learn what Git squashing is, talk about when we need to squash commits, and take a closer look at how to squash commits