Tagged: #html

Serve Static Resources with Spring Boot

In this tutorial we show how Spring Boot serves static resources like (html, js, css) in a web application. 1- Default path for static resources By default Spring Boot serves static resources defined under the following paths: /META-INF/resources/ /resources/ /static/ /public/ Except for index.html which is served as the root resource when accessing the root URL of a Spring Boot application,...

Pass data from javascript to servlet

In modern web applications, the data exchange between front-end and back-end is usually done dynamically through javascript. In this tutorial, we explain 2 ways of exchanging data between javascript and java servlets, we also provide an example and business cases for the usage of each way. 1. Submit form programatically The first case is when you already have an html...

Pass data from html to servlet

In this tutorial we explain the common way of passing data from html to java servlets, we mostly focus on passing form data entered by end-users through pages like: login, sign-up, contact-us .. 1. Pass form fields to servlet Consider the following login.html:

Users interact with web applications through forms, the “form” element is the common way for asking end-users...