Friday, October 4, 2019

Spring boot from command line / terminal

Ứng dụng spring boot nên được tạo từ spring initializr (start.spring.io)
If mvn is installed on your computer:
mvn package
mvn spring-boot:run
or
java -jar target/file.jar
If not
./mvnw package
./mvnw spring-boot:run

Sunday, September 29, 2019

Spring boot

Change directory to the source code
cd /where/the/pom/file/is
mvn install
Run application server
mvn spring-boot:run
Application will be started with port 8080

Friday, September 27, 2019

What is a Spring Bean

A "Spring Bean" is simply a Java object.
When Java objects are created by the Spring Container, then Spring refers to them as "Spring Beans".
Spring Beans are created from normal Java classes .... just like Java objects.
---
Here's a blurb from the Spring Reference Manual
---
In the early days, there was a term called "Java Beans". Spring Beans have a similar concept but Spring Beans do not follow all of the rigorous requirements of Java Beans.
---
In summary, whenever you see "Spring Bean", just think Java object. :-)

Thursday, September 26, 2019

Cài đặt môi trường code trên ubuntu

apt-get update && apt-get upgrade
jdk
sudo apt install openjdk-8-jdk
Tomcat
apt-get install tomcat8
cd /usr/share/tomcat8
sudo ln -s /var/lib/tomcat8/conf conf
sudo ln -s /var/log/tomcat8 log
sudo ln -s /etc/tomcat8/policy.d/03catalina.policy conf/catalina.policy
sudo chmod -R a+rwx /usr/share/tomcat8/conf
systemctl stop tomcat8 // để chạy tomcat từ eclipse trên cổng 8080
Tải eclipse installer từ eclipse.com


Spring

Thursday, July 19, 2018

Kinh nghiệm build môi trường

Dự án: website quản lý bán vé cho VFF liên đoàn bóng đá việt nam
Tôi đã có sẵn source và dump của database
Khi build project thì
build bằng dòng lệnh => lỗi
build bằng eclipse => có thể chạy được nhưng bất ổn định (lúc lỗi lúc không)
mvn clean
mvn install
Nếu build lỗi vài lân => xóa thư mục .m2 đi để mvn tự kéo về

Tuesday, July 17, 2018