Skip to content

Software Development at Program Tom LTD

Place for coding, programming, development and software in general.

Menu
  • Blog
  • PDF Booklets
  • Dev Utils & Content
  • Java Spring Boot Or Web Apps
  • English
    • български
    • English
    • Español
    • Português
    • हिन्दी
    • Русский
    • Deutsch
    • Français
    • Italiano
    • العربية
  • About Us
  • Cart
Menu

Category: Spring

Object Mapping - examples With Java Spring Boot

Object Mapping – examples With Java Spring Boot

Posted on March 21, 2025March 21, 2025 by Toma Velev

There are several Java Frameworks available that does Object Mapping – automatic creation of DTO (Data Transfer Object) in Spring Boot. Reasons we need it Spring (Boot) Framework saves a lot of time of developers by hiding complexity and placing smart defaults with convention over configuration. This comes with the price of a “magic” happening…

Read more
Database Integrations in Spring Boot

Database Integrations in Spring Boot

Posted on March 12, 2025 by Toma Velev

Here are minimal examples of different Database Integrations in Spring Boot that you could choose from in your applications. 1. JdbcTemplate (Plain JDBC) JdbcTemplate is a lower-level approach that directly executes SQL queries. import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Repository; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; @Repository public class UserJdbcRepository { private final JdbcTemplate jdbcTemplate; public…

Read more
How to Update a Table using Sping Repository Modifying Query

How to Update a Table using Sping Repository Modifying Query

Posted on February 27, 2025 by Toma Velev

You can use Spring Data JPA’s @ Modifying and @ Query annotations to achieve Update a field of a Table using Sping Repository Modifying Query. Spring Repository Here is an example: import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.transaction.annotation.Transactional; public interface UserRequestRepository extends CrudRepository<UserRequest, Long> { @Modifying @Query(“UPDATE UserRequest u SET u.fieldCount = 0”) void…

Read more
How to check every request in spring boot & if it is invalid - return 401

How to check every request in spring boot & if it is invalid – return 401

Posted on February 4, 2025 by Toma Velev

How to check for presence of specific header in every request with spring boot and if it is not – return 401? You can achieve this by implementing a custom HandlerInterceptor in Spring Boot. Here’s an example: import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; //import javax.servlet.http.HttpServletRequest; //import javax.servlet.http.HttpServletResponse; import java.util.Arrays; @Component public…

Read more
IOException: Stream Closed - when having ResponseEntity - a file

IOException: Stream Closed – when having ResponseEntity – a file

Posted on January 18, 2025 by Toma Velev

The error java.io.IOException: Stream Closed indicates that the InputStream passed to the InputStreamResource has already been closed before it is read by the Spring framework to create the response. Use Case The use case where you may need to encounter this error is file download from Spring Boot App. Writing down bytes loaded in memory…

Read more
How to implement partial commits in a spring boot service when using spring repositories

How to implement partial commits in a Spring Boot service when using spring repositories

Posted on December 28, 2024 by Toma Velev

Implementing checkpoint or partial commits within a database transaction in a Spring Boot service can be tricky since Spring transactions are designed to be atomic: they either fully commit or fully roll back. However, you can achieve a similar effect by managing transactions explicitly in your service layer and leveraging Spring’s PlatformTransactionManager or nested transactions…

Read more
How to Execute something after a Spring Bean is Initialized

How to Execute something after a Spring Bean is Initialized

Posted on December 11, 2024December 23, 2024 by Toma Velev

You can use several methods to Execute something after a Spring Bean is Initialized but the most popular one is the @PostConstruct annotation. Here’s an example: import org.springframework.stereotype.Component; @Component public class MyBean { @PostConstruct public void init() { System.out.println(“My bean is initialized”); // Your code here } } In this example, The Spring Engine will…

Read more
Allow Spring Boot Endpoint to be called only from Internal Network

Allow Spring Boot Endpoint to be called only from Internal Network

Posted on December 8, 2024 by Toma Velev

You can achieve an Spring Boot Endpoint to be called only from Internal Network by using the built-in support for security and configuring a filter to check the IP address of incoming requests. Here are the steps: Step 1: Add dependencies In your pom.xml file (if you’re using Maven) or build.gradle file (if you’re using…

Read more
How to add SVG to Vaadin

How to add SVG to Vaadin

Posted on December 8, 2024 by Toma Velev

Vaadin is a popular Java framework for building Web Applications, so it is logical to have the ability to add SVG to the Vaadin Web App. Method 1: Using Vaadin’s built-in SVG support Vaadin provides a built-in way to display SVGs using the SVG class. Here’s an example: import com.vaadin.flow.component.html.Div; import com.vaadin.flow.server.VaadinRequest; public class MyUI…

Read more
What could be the reason for Spring Repository cannot Delete Record

What could be the reason for Spring Repository cannot Delete Record

Posted on December 8, 2024 by Toma Velev

There are several reasons why a Spring Repository might not be able to Delete a Record. Here are some possible causes: No Transaction Spring Data JPA uses transactions by default, but if you’re not using a transaction manager or the @Transactional annotation, the delete operation might not be committed. Incorrect Query Make sure that the…

Read more

Posts pagination

  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
  • Prompt-to-Production: How AI is Forcing Us to Build Higher Quality Software
  • Debug Web View Flutter App
  • Skipping AI? You’re a Relic – Time to Evolve or Perish!
  • 2026 Flutter Launch Blueprint: Your 10-Step Checklist to App Store Domination
  • Product Requirements Document – for different software development levels

Categories

  • Apps (25)
  • ChatGPT (27)
  • Choosing a Framework (38)
  • Flutter (281)
  • Graphical User Interface (14)
  • Marketing (119)
  • Software Development (292)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (16)

Tags

Algorithms (9) crypto (29) flutterdev (39) General (86) Java (7) QR & Bar Codes (3) Software Dev Choices (33) Spring Boot (1) standards (1) Theme (3) User Authentication & Authorization (9) User Experience (10) Utilities (19) WordPress (11)

Product categories

  • All Technologies (87)
    • Flutter Apps (26)
    • GPT (4)
    • Java (39)
    • Native Android (3)
    • PHP (9)
    • Spring (Boot) / Quarkus (36)
    • Utils (15)
    • Vaadin 24+ (28)
    • Vaadin 8 (1)
  • Apps (18)
    • Employees DB (1)
    • Notes (6)
    • Personal Budget (1)
    • Recipes Book (1)
    • Stuff Organizer (1)
    • To-Do (2)
  • PDF Books (3)
  • Source Code Generators (8)

Recent Posts

  • Prompt-to-Production: How AI is Forcing Us to Build Higher Quality Software
  • Debug Web View Flutter App
  • Skipping AI? You’re a Relic – Time to Evolve or Perish!
  • 2026 Flutter Launch Blueprint: Your 10-Step Checklist to App Store Domination
  • Product Requirements Document – for different software development levels

Post Categories

  • Apps (25)
  • ChatGPT (27)
  • Choosing a Framework (38)
  • Flutter (281)
  • Graphical User Interface (14)
  • Marketing (119)
  • Software Development (292)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (16)