@manhng

Welcome to my blog!

Java App

February 9, 2022 15:32

Java App (edit)

Java to C# Converter

CodeTranslator: Code Translation From VB.NET <-> C# <-> TypeScript <-> Java (carlosag.net)

A Look at Dapper.NET - CodeProject (C# and VB.NET)

ASP.NET Web Forms Project Using Dapper ORM (VB.NET) - VBForums (VB.NET)

dotnetgenetics/ASP.NET-WebForm-Dapper-VB.NET: ASP.NET WebForm Visual Basic.NET project using Dapper Micro ORM (github.com) (VB.NET)

paulirwin/JavaToCSharp: Java to C# converter (github.com)

Microsoft Launches Java-to-C# Converter | Developer.com

The below links might help:

  1. Microsoft Launches Java-to-C# Converter;
  2. Tangible Software Solutions inc..

Bài toán:

  • Type: Java App (giống Windows Forms bên .NET)
  • Language: Java
  • DB: PostgreSQL
  • Data Access Layer: MyBatis
  • Caching: Cache của MyBatis cho những dữ liệu ít thay đổi
  • Logging: Log4j
  • Excel: Apache POI
  • PDF: iText
  • INI: Ini4j

Tổng quan:

  • Java Servlet
  • JavaServer Pages
  • Java Expression Language
  • Java WebSockets

Mục tiêu cần đạt được

  • Codebase for Java Web
  • Codebase for Java App
  • SCRUD
    • S: Search, Filtering, Ordering, Paging
    • C: Create
    • U: Update
    • D: Delete
  • SCRUD with Category & Product
    • Connection Timeout
    • Transaction
    • Command Timeout
  • Error handling: Log4j (.log or database)
  • User behavior analytics: Log4j (.log or database)
  • Work with Excel: Apache POI (read, write)
  • Work with PDF: iText (read, write)
  • Work with Word: Apache POI (read, write)
  • Deploy Java App onto server Tomcat & Apache
    • Apache HTTP Server (AHS)
    • Apache Tomcat

Hướng dẫn ban đầu

https://openplanning.net/11267/huong-dan-lap-trinh-spring-boot-cho-nguoi-moi-bat-dau (HAY HAY HAY)

https://shareprogramming.net/cach-tai-va-cai-bien-moi-truong-maven-tren-windows

Spring Boot Connect to PostgreSQL Database Examples (codejava.net)

Java - JDBC PostgreSQL Batch Insert Example (javaguides.net)

Spring Boot Tutorial - Learn Spring Boot in 10 Hours - YouTube

Spring Boot Tutorial - Learn Spring Boot in 10 Hours - YouTube (all videos)

Java Cheat Sheet

Java Cheat Sheet (2022) - InterviewBit

AlgoDaily - Java Interview Questions Cheat Sheet - Introduction

Learn Java: Object-Oriented Java Cheatsheet | Codecademy

Java Cheatsheet | CodeWithHarry

Java Programming Cheatsheet (princeton.edu)

Java Command Prompt

Hướng dẫn cách biên dịch và thực thi Java bằng Command Prompt (quantrimang.com)

Java Web

How to create a Spring Boot Web Application (Spring MVC with JSP/ThymeLeaf) (codejava.net)

Hướng dẫn lập trình Spring Boot cho người mới bắt đầu (openplanning.net) (HAY HAY HAY)

Học Spring Boot bắt đầu từ đâu? (viblo.asia) (HAY HAY HAY)

Giới thiệu về Spring Boot. Spring Boot là gì? | TopDev (HAY HAY HAY)

Spring Boot là gì? Giới thiệu Spring Boot Framework - STACKJAVA (HAY HAY HAY)

Làm việc với file .INI

Mybatis Generator: What's the best way to separate out "auto generated" and "hand edited files" - Stack Overflow

A Simple and Efficient INI File Reader in C# - CodeProject

What is the easiest way to parse an INI file in Java? - Genera Codice

An Enhanced INI File Class for Java - CodeProject

[ini4j] - Java API for handling Windows ini file format (sourceforge.net)

How to read (parse) from and write to INI files easily in Java | Our Code World

Cài đặt môi trường

1) Java Development Kit (JDK)

https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html

Cài đặt xong thì đọc tiếp:

Java Platform Standard Edition 8 Documentation (oracle.com)

Thêm biến môi trường JAVA_HOME ở cả User variables và System variables

Sửa biến Path, thêm mới C:\Program Files\Java\jdk1.8.0_202 ở cả User variables và System variables

Kiểm tra đã cài Java chưa bằng cách chạy CMD > java -version

C:\WINDOWS\system32>java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

2) Maven

https://maven.apache.org/download.cgi

Download về và giải nén ra C:\Maven

Thêm biến môi trường MAVEN_HOME ở cả User variables và System variables

Sửa biến Path, thêm mới C:\Maven ở cả User variables và System variables

Kiểm tra đã cài Maven chưa bằng cách chạy CMD > mvn -version

C:\WINDOWS\system32>mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: C:\Maven
Java version: 1.8.0_202, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_202\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

3) Spring Tools

https://spring.io/tools

Download về và giải nén ra C:\SpringToolSuite

Vào trong thư mục C:\SpringToolSuite

Giải nén tiếp tệp contents.zip ra C:\SpringToolSuite\contents\ (extract here)

C:\WINDOWS\system32>java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

C:\WINDOWS\system32>mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: C:\Maven
Java version: 1.8.0_202, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_202\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Spring Tool Suite STS = Eclipse + Spring Tools plugin

Java Framework

Nếu Java Batch -> https://github.com/terasoluna-batch/

Nếu là Java App + Web -> https://github.com/terasolunaorg/

Deploy

Deploy a Java web application inside a Tomcat server container | IntelliJ IDEA (jetbrains.com)

How to deploy a Java web application on Tomcat (codejava.net)

  • .JAR
  • .WAR

As we can see, there are two ways for deploying a web application using the manager:

  • Deploy directory or WAR file located on server.
  • WAR file to deploy.

Apache Tomcat Server vs Apache Web Server

Difference between Apache Tomcat server and Apache web server - GeeksforGeeks

Tomcat vs. Apache HTTP Server: What's the difference? (theserverside.com)

Categories

Recent posts