Java

1 / 1

Java Variant Type

213

Overview of Variant Types in JavaIn type theory,a Variant Type (also known as a Sum Type,Tagged Union,or Discriminated Union) represents a data structure that can hold a value of one of several distinct,pre-defined types at any given time. Unlike languages...

What Replaced JSP? Modern Java Web Dev Explained (with Examples)

What Replaced JSP? Modern Java Web Dev Explained (with Examples)

267

JavaServer Pages (JSP) is largely considered an outdated technology for developing new web applications.While it still exists in many legacy systems and is maintained,the industry has shifted away from its model for modern development.Its core approach of ...

Why Java Spring Framework is Considered Optimized for Docker

Why Java Spring Framework is Considered Optimized for Docker

1,032

The Java Spring Framework,especially Spring Boot,is highly regarded for its suitability for Docker and containerized environments due to several inherent design characteristics::Self-Contained Executable JARs / WARs: Spring Boot applications can be easily ...

Spring Framework: Evolution, Trends, and Architectural Innovation

Spring Framework: Evolution, Trends, and Architectural Innovation

1,275

The Java Spring Framework began as a lightweight alternative to complex J2EE,revolutionizing enterprise development with its core principles of Inversion of Control and Dependency Injection,subsequently evolving into a comprehensive ecosystem that notably ...

Java Maps: HashMap vs. LinkedHashMap vs. TreeMap Explained

Java Maps: HashMap vs. LinkedHashMap vs. TreeMap Explained

234

In Java,the Map interface is part of the java.util package and represents a collection that stores key-value pairs.Each key in a Map must be unique,and it maps to a single value.Maps are crucial for various programming scenarios where you need to associate...

Java Kafka on CentOS 7: Install, Configure, & Run with Examples

Java Kafka on CentOS 7: Install, Configure, & Run with Examples

431

This guide will walk you through installing Java and Apache Kafka on a CentOS 7 system,followed by providing three simple Java examples to interact with Kafka. 1.System Setup and PrerequisitesBefore installing Java and Kafka,ensure your system is up-to-dat...

Beyond venv: Java's Project Isolation Strategy

Beyond venv: Java's Project Isolation Strategy

486

While Java doesn't have an exact equivalent to Python's venv (virtual environment) which creates an isolated directory containing a specific Python interpreter and its own set of installed packages,it achieves similar goals of project isolation and depende...

Simple Java Code to display Hello, World on the web

Simple Java Code to display Hello, World on the web

569

Introduction to Java Web ApplicationsTo display "Hello,World" on the web using Java,you need to create a web application.This involves a server-side component written in Java that responds to HTTP requests from web browsers (clients).The standard for build...

How to add a declaration on JSP code ?

1,128

If you have developed C or C++ program,you may know below examples. Above code have no bug,but no code will be compiled,because it's all declarations.In JSP,you can make declarations as well.In some documents,a declarations is also called as remark.To add ...

How to include file in JSP ?

1,256

Just like ASP,or PHP,JSP is also allow to include for programmer by include function.Here's the simple example.

How to set and get sessions on JSP code ?

1,041

Here's the simple example to set and put sessions.save_my_name,jsp.save_my_name.jsp saves the user's name in the session,and puts a link to another page,next_page.jsp.next_page.jsp shows how to retrieve the saved name.next_page.jsp.

How to print out text strings on HTML directly ?

909

In JSP, you can print out text strings by out.println(). Here's the example. <%    / / This scriptlet declares and initializes "date"    System.out.println( "Evaluating date now" );    java.util.Date date = new ...

Clipboard copy function working

3,382

When copying trackback address or shortcut url on the articles, clipboard function is really useful.But there are some compatibility issue in browsers.I checked below function is working on Microsoft Internet Explorer. For supporting Firefox, you need to f...