Fork me on GitHub


First week java web development - WD-041913

Last week, I start my journey on back-end web development. Below are some references from internet for getting some basic understanding on java web development.


Introduction into Java Web development

This tutorial introduces some basic concept about web development and java part: JSP and servlet.

REST with Java (JAX-RS) using Jersey - Tutorial

This helps me to build a simple JAX-RS web app and deploy it to Tomcat servlet container.

MySQL and Java JDBC - Tutorial & Connect To MySQL With JDBC Driver

These help me understand how to use JDBC to access MySQL database.


What is Java Servlet

A servlet is a Java programming language class used to extend the capabilities of a server. Technically speaking, a "servlet" is a Java class in Java EE that conforms to the Java Servlet API.

Servlets are most often used to

  • Process or store data that was submitted from an HTML form
  • Provide dynamic content such as the results of a database query
  • Manage state information that does not exist in the stateless HTTP protocol, such as filling the articles into the shopping cart of the appropriate customer


Below are some solution for the problem I met

INSTALLING Oracle Java JDK 7 On Ubuntu 12.04 Step By Step

How do I import the javax.servlet API in my Eclipse project?

Right click on project ---> Properties ---> Java Build Path ---> Add Library... ---> Server Runtime ---> Apache Tomcat ----> Finish.

Apache2, MySQL, php, phpmyadmin installation on ubuntu12.04

注意,要把 phpadmin conf 加到 apache 裡面

Ref: 1, 2

sudo vim /etc/apache2/apache2.conf  
Include /etc/phpmyadmin/apache.conf //Add the phpmyadmin config to the file    
sudo service apache2 restart //then restart apache

Java Naming and Directory Interface

-- EOF --


[Bash] Annoying directory green highlight in terminal

Recently, I found some directory become green highlighted in the background when I issue ls command as below picture.

After google that, it is due to the write permission of the others (as the red mark in the picture). There are 2 ways to fix this annoying coloring.

  1. Change the bash color setting: refer to the Reference 2
  2. Use the chmod to recover the directory permission to default 755, or use below command to recursively set all directory to default 755

    $ find . -type d -print0 | xargs -0 chmod 755 


  1. Gnome-terminal syntax highlighting - green highlight?
  2. NTFS directory coloring in terminal
  3. Wikipedia: File system permissions
  4. Wikipedia: Sticky_bit
  5. How to chmod 755 all directories but no file (recursively)