Author: Vijay SRJ

  • How to drag and drop a file into a HTML page using HTML5?

    As mentioned in the previous post, drag and drop got easier with HTML5. You just mark the element to be dragged as draggable and then drag and drop it on a HTML element. But how can files be dragged from , say your desktop , and then dropped on a HTML element, say a text…

  • How to implement drag and drop in HTML5?

    Dragging and dropping content in your html document got easier with HTML5. You just need to mark the element you want to drag as “draggable”, drag it and drop it using some simple javascript. Here are the steps: STEP1: Mark the HTML element to drag as draggable STEP2: Write a javascript function for the event…

  • How to show edits in a HTML document?

    Let’s say you created a HTML document with some content . You published it and your users have already started viewing it. And then suddenly you wanted to make some changes. You want to insert new data and delete old ones. You want to do this without affecting the user experience. How do you that?…

  • How to create an accordion in HTML5?

    Creating an accordion got easier in HTML5. You don’t need to use div element and javascript anymore. You just need to use the <details> element. The label in the accordion can be represented using <summary> element nested inside the <details> element and the data inside the accordion can then be represented using <p> (paragraph) element…

  • How to track your website link clicks using a single HTML attribute?

    Let’s say you have created a web app. You have lots of hyperlinks in your app, either to your own web pages or to external resources. You want to track those links: Who clicked it? When was it clicked? How many times a particular link was clicked? Until HTML5, you had to write javascript code…

  • What are the different ways to represent text in HTML?

    There are so many ways to represent text in HTML. The HTML specs specify 29 different ways to mark up text. Here are they: You can hyperlink to a text or even a section of text or a picture using <a> element Example: When user clicks on the words “The Full Stack Developer” they will…

  • How to group HTML content?

    In the previous post as part of this series I wrote about how to structure content in HTML. In this post we will see how to group content. (Grouping is how to group related data together and structuring is more about where to place each type of content in a HTML document) According to the…

  • How to retry service calls in Spring Boot ?

    Let’s say you are building a spring boot app which calls other third party REST APIs. And those APIs are not very reliable. They throw error at times but works fine most of the times. So you want to retry hitting them when they error out so that you are chance of getting a response…

  • How to read HTTPRequest in Spring Boot Exception Handler?

    Let’s say you want to centralize exception handling in your spring boot application. Whenever any of your APIs throw exception you want to handle them in a centralized way. How can you do this? Using Spring’s Exception Handler. You create a class annotated with @ControllerAdvice annotation and write a method annotated with @ExceptionHandler . You…

  • How to log incoming requests to all REST services in Spring Boot?

    (As an alternate to the below solution you can check out this post , which is easier and more straightforward) Let’s say you want to log all the requests to your REST APIs developed using Spring Boot in a centralized way. You don’t want to add logs to each and every API. How to do…