<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Piyush Kulkarni</title>
    <description>The latest articles on DEV Community by Piyush Kulkarni (@techtester99).</description>
    <link>https://dev.to/techtester99</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4130396%2Fdf63109c-0b8c-4339-a0f7-ff00a2045fa5.png</url>
      <title>DEV Community: Piyush Kulkarni</title>
      <link>https://dev.to/techtester99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/techtester99"/>
    <language>en</language>
    <item>
      <title>Spring boot learning by doing</title>
      <dc:creator>Piyush Kulkarni</dc:creator>
      <pubDate>Sat, 26 Sep 2026 07:00:54 +0000</pubDate>
      <link>https://dev.to/techtester99/spring-boot-learning-by-doing-4b78</link>
      <guid>https://dev.to/techtester99/spring-boot-learning-by-doing-4b78</guid>
      <description>&lt;p&gt;In a previous post, I used a linked list to create a CRUD application. However, to save data permanently, a linked list is not sufficient; you need to utilize a database, which will allow data to persist even after closing the application.&lt;/p&gt;

&lt;p&gt;As a beginner, I opted for the H2 in-memory database. This choice was made to avoid the need to download and configure a full relational database like MySQL or PostgreSQL, making the setup easier. I plan to switch to a more robust database in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring the H2 In-memory Database
&lt;/h3&gt;

&lt;p&gt;In the &lt;code&gt;application.properties&lt;/code&gt; file, you will add three grouped configurations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;H2 Database Configuration&lt;/strong&gt;: This setup creates an in-memory database, meaning the database resides in your RAM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JPA Configuration&lt;/strong&gt;: What is JPA (Jakarta Persistence API)? Instead of writing SQL queries manually, you can write Java code, and JPA will translate it into SQL queries to be executed on the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;H2 Database Console Configuration&lt;/strong&gt;: This provides a visual representation of your in-memory database, accessible via a web browser, typically at &lt;code&gt;http://localhost:8080/h2-console&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here are the configurations you would include in the &lt;code&gt;application.properties&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;spring.application.name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;demo&lt;/span&gt;
&lt;span class="py"&gt;server.port&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;8080&lt;/span&gt;

&lt;span class="c"&gt;# H2 Database Configuration
&lt;/span&gt;&lt;span class="py"&gt;spring.datasource.url&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;jdbc:h2:mem:taskdb&lt;/span&gt;
&lt;span class="py"&gt;spring.datasource.driverClassName&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;org.h2.Driver&lt;/span&gt;
&lt;span class="py"&gt;spring.datasource.username&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;sa&lt;/span&gt;
&lt;span class="py"&gt;spring.datasource.password&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;password&lt;/span&gt;

&lt;span class="c"&gt;# JPA Configuration
&lt;/span&gt;&lt;span class="py"&gt;spring.jpa.database-platform&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;org.hibernate.dialect.H2Dialect&lt;/span&gt;
&lt;span class="py"&gt;spring.jpa.hibernate.ddl-auto&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;update&lt;/span&gt;
&lt;span class="py"&gt;spring.jpa.show-sql&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# H2 Console Configuration
&lt;/span&gt;&lt;span class="py"&gt;spring.h2.console.enabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;spring.h2.console.path&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/h2-console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The URL is used to create the database for you, while the driver class connects your application to the database. The username and password are the credentials required to access the database.&lt;/p&gt;

&lt;p&gt;The "dialect" varies for each relational DBMS (Database Management System). Although they all use SQL, the syntax can differ slightly among different DBMS software. Thus, while the language remains the same, the dialect is different, which is why it's essential to specify the particular dialect for which JPA (Java Persistence API) will generate queries.&lt;/p&gt;

&lt;p&gt;Setting &lt;code&gt;ddl-auto=update&lt;/code&gt; allows your database to be updated according to the entity classes defined in your application. The &lt;code&gt;show-sql&lt;/code&gt; option lets you view the SQL queries generated by JPA in the terminal.&lt;/p&gt;

&lt;p&gt;This configuration will allow you to work with an H2 in-memory database effectively, providing both ease of use and accessibility for development purposes. Please remember to add the Spring Data JPA dependency in the pom.xml file.&lt;/p&gt;

</description>
      <category>spring</category>
      <category>java</category>
      <category>springboot</category>
      <category>database</category>
    </item>
    <item>
      <title>Spring Boot Learning by doing</title>
      <dc:creator>Piyush Kulkarni</dc:creator>
      <pubDate>Mon, 21 Sep 2026 17:12:04 +0000</pubDate>
      <link>https://dev.to/techtester99/spring-boot-learning-by-doing-21mf</link>
      <guid>https://dev.to/techtester99/spring-boot-learning-by-doing-21mf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Learning Spring by doing.&lt;/strong&gt; In this post, I'll share the &lt;strong&gt;steps&lt;/strong&gt; I took to create my first &lt;strong&gt;Spring Boot application&lt;/strong&gt;. There's less theory in this guide (you can find that elsewhere); instead, I'll focus on the steps to take, how to do them, and the &lt;strong&gt;reasoning behind those steps&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In my previous blog post, I created a &lt;strong&gt;controller&lt;/strong&gt; with one request-handling method. It simply returned the string &lt;strong&gt;"Hello, World!"&lt;/strong&gt; when you accessed the endpoint &lt;strong&gt;localhost:8081/hello&lt;/strong&gt;, as the request-handling method was mapped to that endpoint. In Java, everything is an object, so the next thing we need is a simple &lt;strong&gt;POJO (Plain Old Java Object)&lt;/strong&gt; class to carry our data. This could be a class like &lt;strong&gt;Student&lt;/strong&gt;, &lt;strong&gt;Car&lt;/strong&gt;, &lt;strong&gt;Employee&lt;/strong&gt;, etc. In this case, we created a &lt;strong&gt;Task POJO class&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Next, we will create more request-handling methods that perform some &lt;strong&gt;logic&lt;/strong&gt; on that data and return the &lt;strong&gt;output&lt;/strong&gt;. To manipulate the data and save the results (for future retrieval), you typically need a &lt;strong&gt;database&lt;/strong&gt;. However, as a beginner, I decided to use a simple &lt;strong&gt;list of Tasks&lt;/strong&gt; and return its results instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CRUD Operations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create (HTTP POST Request)&lt;/strong&gt;: - &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the Create operation, I annotated the request-handling method with the &lt;code&gt;@PostMapping&lt;/code&gt; annotation to map it to an endpoint. In this method, we fetch the JSON data sent by the client from the HTTP request body and create a &lt;code&gt;Task&lt;/code&gt; object using that data. We do this with the &lt;code&gt;@RequestBody&lt;/code&gt; annotation, which allows us to receive a pre-made object directly from Spring Boot. We then add this object to the list of tasks we created.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Read ( HTTP GET Request)&lt;/strong&gt;: -&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the Read operation, I annotated the request-handling method with the &lt;code&gt;@GetMapping&lt;/code&gt; annotation to map it to an endpoint. In this method, we just return the list of tasks that we created and added some task objects.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update (HTTP PUT Request)&lt;/strong&gt;: - &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the Create operation, I annotated the request-handling method with the &lt;code&gt;@PutMapping&lt;/code&gt; annotation to map it to an endpoint. In this method, we fetch the JSON data sent by the client from the HTTP request body and create a &lt;code&gt;Task&lt;/code&gt; object using that data. We do this with the &lt;code&gt;@RequestBody&lt;/code&gt; annotation, which allows us to receive a pre-made object directly from Spring Boot. We also fetch the ID of the object to be updated from the request URL path variable. We use the @PathVariable annotation to get that ID. Then we replace the details of the existing object with the new object provided by Spring Boot, which was made using data from the client PUT request that came in.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Delete (HTTP DELETE Request)&lt;/strong&gt;: - &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the Delete operation, I annotated the request-handling method with the &lt;code&gt;@DeleteMapping&lt;/code&gt; annotation to map it to an endpoint. In this method, we fetch the ID of the object to be deleted from the request URL path variable. We use the @PathVariable annotation to get that ID. Then we delete that object from the list.&lt;/p&gt;

&lt;p&gt;Code snippet: -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.demo.controllers&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;


&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.demo.entity.Task&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.web.bind.annotation.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.time.LocalDateTime&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.ArrayList&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@RestController&lt;/span&gt;
&lt;span class="nd"&gt;@RequestMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/tasks"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TaskController&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@GetMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/getTasks"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;getAllTasks&lt;/span&gt;&lt;span class="o"&gt;(){&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@PostMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/addTask"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;addTask&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@RequestBody&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;

        &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setId&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;++);&lt;/span&gt;
        &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setCreatedAt&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;LocalDateTime&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;now&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setCompleted&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;


        &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@DeleteMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/deleteTask/{id}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;deleteTask&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@PathVariable&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;

        &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;removeIf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@PutMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/updateTask/{id}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;updateTask&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@PathVariable&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@RequestBody&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="n"&gt;updatedTask&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;

        &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++){&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
                &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;setTitle&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;updatedTask&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getTitle&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
                &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;setCompleted&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;updatedTask&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getCompleted&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
                &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;setDescription&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;updatedTask&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getDescription&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>java</category>
      <category>learning</category>
      <category>springboot</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Spring Boot Learning by Doing</title>
      <dc:creator>Piyush Kulkarni</dc:creator>
      <pubDate>Sat, 19 Sep 2026 06:12:43 +0000</pubDate>
      <link>https://dev.to/techtester99/spring-boot-learning-by-doing-53je</link>
      <guid>https://dev.to/techtester99/spring-boot-learning-by-doing-53je</guid>
      <description>&lt;p&gt;So I'm a beginner of spring boot learning it by doing. Here will be only steps (not much theory) of creating spring boot app. Even though I've read theory of spring boot I rarely know what to do next when I actually start making spring boot app.&lt;/p&gt;

&lt;p&gt;So in this I'll write what to do, how to do and why we do it? With very little Theory. Now as most beginners do, I'm going to create simple web app and these steps are based on it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Application class&lt;/strong&gt; (@SpringBootApplication): - &lt;br&gt;
When you first create a project, you automatically get this class generated. It's mostly your application name+ Application (eg, For Taskmanager its TaskmanagerApplication).&lt;/p&gt;

&lt;p&gt;It is annotated with @SpringBootApllication annotation which I've talked about in previous blog.&lt;/p&gt;

&lt;p&gt;This app is starting point of your application. It has main method in it Springapplication.run() method which bootstraps and launches your app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Controller&lt;/strong&gt; -&lt;br&gt;
Second thing you create is most of the time is a controller class. A Java class annotated with @Controller/@RestController. This class contains handler methods which receives client request performs some action and returns the response. &lt;/p&gt;

&lt;p&gt;Make sure you create a package named Controller inside the package in which your main class with @SpringBootApplication is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.Request Handling Methods&lt;/strong&gt; -&lt;br&gt;
These are annotated with @GetMapping and similar annotations with url path mapped in it. Any request coming from that url is handled by this method. &lt;/p&gt;

&lt;p&gt;For starting, we will just return "Hello, World!" and it'll be sent back as response and displayed in browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqidd8iar8xzu3pjysq6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqidd8iar8xzu3pjysq6w.png" alt="example code snippet or controller and handler method" width="799" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now Spring boot automatically configures your server which is tomcat and it runs on port 8080 so go on &lt;a href="http://localhost:8080/hello" rel="noopener noreferrer"&gt;http://localhost:8080/hello&lt;/a&gt; or any endpoint you have created and you'll see the hello world message.&lt;/p&gt;

&lt;p&gt;Because your application class is annotated with @SpringBootApplication it includes component-scan, which checks for components inside the current package and its sub packages by help of annotations. @Controller is also one of those components annotations. &lt;strong&gt;So Springboot creates the TaskController object and registers it inside context so spring can manage  it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thats it for today. You can check theory of few things like application context/contianer, SpringApplication.run() method, how spring configures application, web MVC, request response rendering, client-server communication etc.&lt;/p&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>springboot</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Learning Spring Boot By Doing</title>
      <dc:creator>Piyush Kulkarni</dc:creator>
      <pubDate>Thu, 17 Sep 2026 21:37:18 +0000</pubDate>
      <link>https://dev.to/techtester99/learning-spring-boot-by-doing-day-1-1b4o</link>
      <guid>https://dev.to/techtester99/learning-spring-boot-by-doing-day-1-1b4o</guid>
      <description>&lt;p&gt;This is my first post. I just wanted to write something and start. So it is here.&lt;/p&gt;

&lt;p&gt;I am a theory person. I like learning the mental theory or use case theory about any development concepts. I don't usually code unless I understand theory perfectly. &lt;/p&gt;

&lt;p&gt;Which I think is very big drawback. So even though I know some theory about spring boot I never made apps using it. &lt;/p&gt;

&lt;p&gt;So today my goal was to initialize simple spring app and remember next time how to do the same.&lt;/p&gt;

&lt;p&gt;So this might feel dumb, but this is how I remember it:&lt;/p&gt;

&lt;h2&gt;
  
  
  Spring Intializer
&lt;/h2&gt;

&lt;p&gt;1.First, you go to &lt;strong&gt;spring initializer&lt;/strong&gt; (&lt;a href="https://start.spring.io/" rel="noopener noreferrer"&gt;https://start.spring.io/&lt;/a&gt;), add project name, domain name, choose dependency management tool-Maven, Java version 21, configuration- properties and most important - add dependencies like Spring web, Spring Data JPA etc. Download the jar file and open it in either IntelliJ IDE or STS (Spring tool suite).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbhqh7shwuvr18eno0l19.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbhqh7shwuvr18eno0l19.png" alt="Spring Initializer" width="799" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;

&lt;p&gt;2.After that you get simple spring app project structure with dependencies you added while creating project jar file. You get the application. properties file which contains nothing but project name. You get pom.xml file in which project related dependencies are mentioned there with version and what not. When you use spring initializer it fetches the correct names of these dependencies and their matching versions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9m5sq1cqu3irzlv0unjp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9m5sq1cqu3irzlv0unjp.png" alt="Sptring boot initial structure and starting point" width="800" height="429"&gt;&lt;/a&gt;&lt;br&gt;
3.Structure is simple as well, 'src/main/java' -&amp;gt; 'com/example/pk/project_name' (for ex com/ex/pk/TaskManager and then coding part- ProjectNameApplication (for ex, TaskManagerApplication) java class with spring boot annotation @SpringBootApplication above it.&lt;/p&gt;

&lt;h2&gt;
  
  
  @SpringBootApplication
&lt;/h2&gt;

&lt;p&gt;4.&lt;strong&gt;@SpringBootApplication&lt;/strong&gt; annotation is combination of three other annotations: -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;@Configuration&lt;/strong&gt; means this class contains bean definitions, methods that returns bean object&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@EnableAutoConfiguration&lt;/strong&gt; this annotation tells Spring boot to check the dependencies downloaded and configure things according to it. Like if web dependencies are downloaded configure the tomcat server, configure database etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@ComponentScan&lt;/strong&gt; - scan the packages and subpackages in which this class is and register the components you find into spring context. Means it'll check for components annotated with @Controller/@RestController, @Service, @Repositories etc., creates their bean and adds it into Spring context. (Context is like a box inside which beans lives and spring manages them)
4.Run the app, nothing happens mostly. If you added web dependency, go check on localhost:8080 port which is where configured tomcat server is running. You will see the white page with some error page means your app is running.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Inclusion
&lt;/h2&gt;

&lt;p&gt;I know this is very basic stuff, and I've not explained everything perfectly but I'm not focusing on theory, &lt;strong&gt;learn by doing and escape the tutorial hell&lt;/strong&gt; which keeps throwing me back to basics.&lt;br&gt;
But I just wanted to write my first blog. I'll try to be consistent with it. I'm very lazy person with lot of distractions and I'll try to change through this. &lt;br&gt;
Also, I'm not good writer either, but I saw other people's (especially senior Dev's) old blog on their personal websites like Julia Evans (&lt;a href="https://jvns.ca/" rel="noopener noreferrer"&gt;https://jvns.ca/&lt;/a&gt;) or Jeff Atwood(&lt;a href="https://blog.codinghorror.com/" rel="noopener noreferrer"&gt;https://blog.codinghorror.com/&lt;/a&gt;) and thought it's so great and cool. Their dedication, their love, their exploration, their journey and learning everything else was really great. So I wanted to start too.&lt;/p&gt;

&lt;p&gt;You should share your experience too. Let me know how you escaped tutorial hell in comments below!&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>firstpost</category>
      <category>todayilearned</category>
    </item>
  </channel>
</rss>
