Monday, July 5, 2010

eproject status report - Batch 79A

Chào các nhóm của Batch 79A,
     Các nhóm cần gửi một mail báo cáo tiến độ cho eproject team của Ấn Độ với địa chỉ email mà đã gửi cho em project. Ngoài ra  nhớ cc cho mình và Cô Đào giáo vụ nhé.
     + Tiêu đề mail: eproject status report 1
     + Trong mail nhớ gửi:
               ** File word có tên: groupname_projectTitle.doc. Nội dung của file này là các vấn đề về phân tích và thiết kế hệ thống. Các em làm đến đâu thì gửi đến đó. Bản này không quan trọng vì chỉ mang tính chất thông báo tiến độ dự án.
               ** File excel về status report: trong file này nhớ điền đầy đủ thông tin yêu cầu.

Hôm nay ngày 06 - tháng 07 - 2010 là hạn cuối của gửi mail.

       Hiện tại mình chỉ mới nhận được thông tin của các nhóm đã gửi gồm:
  • Group 1: Nguyen Van Ha (Leader), Ngo Son Ba, Doan Ngoc Duy, Le Ho Xuan Dat
  • Group 3: Hoang Nguyen Tam Anh, Ho Hong Nhat, Pham Quang Phuc, Huynh Duc Hoang
(Nhóm 3 cần gửi lại mail vì đánh tiêu đề (subject) chưa đúng.)

Friday, July 2, 2010

SỬ DỤNG RESOURCEBUNDLE TRONG JAVA ĐỂ VIẾT ỨNG DỤNG HỖ TRỢ ĐA NGỮ

      Một ứng dụng thể hiện được tính quốc tế hóa (Internationalization) là một trong những khả năng quan trọng để ứng dụng đó có thể được sử dụng rỗng rãi ở nhiều nơi. Một trong những yếu tố của quốc tế hóa chính là tính đa ngữ cho một ứng dụng. Trong đó khi người sử dụng với đặc điểm của sự khác nhau về ngôn ngữ, văn hóa thì có thể thao tác trên ứng dụng bằng ngôn ngữ của mình. Đặc biệt một ứng dụng được viết hoạt động trên mạng như web applications hay network based applications thì cần phải được cài đạt hỗ trợ đa ngữ. Trong bài này mình muốn giới thiệu cách sử dụng các class của java cung cấp sẵn trong java.util.* để cài đặt ứng dụng đa ngữ.
*** Phạm vi các lớp khảo sát: java.util.Locale; java.util.ResourceBundle;
  • File dữ liệu để chứa text của giao diện được đặt tên là:
                                          demoResource_en_US.properties
                                          demoResource_vn_VN.properties.
  • Ứng dụng demo: viết register_form.jsp (web application) có hỗ trợ thể hiện giao diện tiếng Anh và tiếng Việt.
*** Các bước triển khai:(sử dụng bộ công cụ  netbean để phát triển):
* Bước 1: Tạo một dự án web  application, sau đó chọn tomcat (cái web server khác cũng được) làm web server.
** Bước 2: Trong cửa sổ project, chọn thư mục source package rồi nhấn chuột phải chon new -> other thì sẽ hiện ra cửa sổ và chọn xuống dưới cùng để chọn mục other, phía bên phải của sổ chọn properties file.
Tiếp đó nhấn next và đặt tên file là demoResource_en_US. Một file mới được tạo, sau đó bạn nhập với nội dung sau vào:
   # File nay dung de chua cac key và giá trị của nó
   #phía bên phải là giá trị sẽ được load lên giao diện
   username=User Name
   Password=Password
   OK=Submit
   Cancel=Reset
   Phone=Phone
   Home_addr=Home Address
   Full_Name=Full Name

Làm bước tương tự và đặt file mới tên là demoResource_vn_VN. Sau đó nhập nội dung sau vào
   # File này chứa các key và tên hiển thị tiếng Việt
   # key phía trái phải trùng khớp với file trên. Giá trị bên phải    # phần dịch tiếng Việt
   username=Tài khoản
   Password=Mật khẩu
   OK=Đồng ý
   Cancel=Hủy bỏ
   Phone=Số ĐT
   Home_addr=Địa chỉ nhà
   Full_Name=Họ Tên
***Bước 3: Trong thư mục web pages của cửa sổ project. Chọn new rồi chọn jsp để tạo 1 trang jsp và đặt tên là register_form.jsp.
****Bước 4: mở file vừa tạo và nhập vào nội dung sau:
Mở đầu trang jsp nhập khai báo sau:
<%@page Language="java" contentType="text/html" pageEncoding="UTF-8"%>
<%@page  import="java.util.*" %>

   "http://www.w3.org/TR/html4/loose.dtd">
Trong phần body nhập nội dung sau:
 <% 
    Locale.setDefault(new Locale("vn","VN")); 
    ResourceBundle resourcebundle = ResourceBundle.getBundle("demoResource_en_US");
  %>  
  <form name="form1" action="/register_form.jsp">
  <table border="1">
         <tbody>
         <tr>
   <th>
<%= resourcebundle.getString("username") %></th>
      <th><input type="text" name="username"/> </th>
         </tr>
         <tr>
   <td><%= resourcebundle.getString("Password") %&gt;</td>
        <td><input type="password" name="password"/> </td>
         </tr>
         <tr>
    <td><%= resourcebundle.getString("Full_Name") %&gt;</td>
       <td><input type="text" name="Full Name"/> </td>
         </tr>
         <tr>
   <td><%= resourcebundle.getString("username") %&gt;</td>
     <td><input type="text" name="Email"/> </td>
         </tr>
         <tr>
 <td><%= resourcebundle.getString("Phone") %&gt;</td>
      <td><input type="text" name="Phone"/> </td>
      </tr>
     <tr>
  <td><%= resourcebundle.getString("Home_addr") %&gt;</td>
   <td><input type="text" name="Home_addr"/> </td>
     </tr>
     <tr>
  <td><input type="submit" value="<%= resourcebundle.getString("OK") %&gt;"/> </td>
  <td><input type="reset" value="<%= resourcebundle.getString("Cancel") %>"/> </td>
     </tr>
     </tbody>
     </table>
     </form>
     </body>
*** Giải thích:
1.    Chú ý:
        <%

       Locale.setDefault(new Locale("vn","VN"));
ResourceBundle resourcebundle = 
            ResourceBundle.getBundle("demoResource_en_US ");
     %>

Dòng này chỉ ra locale là tiếng Việt, nước Việt Nam. Sử dụng ResourceBundle để nạp file properties đã tạo vào để tiến hành lấy các key và giá trị key hiển thị lên giao diện.
2.    Chú ý:
     
<th><%= resourcebundle.getString("username") %></th>
      <th><input type="text" name="username"/> </th>

     Dòng này cho phép hiển thị giá trị của key có tên username trong file properties lên giao diện. Tương tự cho các dòng tiếp theo bên dưới.
3.    Chú ý: Khi ta muốn đổi sang hiển thị tiếng Việt thì chỉ cần đổi lại ở dòng:
ResourceBundle resourcebundle = ResourceBundle.getBundle("demoResource_vn_VN ");  

Lúc này refresh lại trình duyệt thì ta sẽ load lại được giao diện tiếng Việt.
*** Hình ảnh demo:
(Nguyễn Võ Quang Đông)

Wednesday, June 30, 2010

Review on JSP - Java Server Page (2)

Tiếp tục là phần ôn tập cho các bài sau:
M6 - Security web application
       1. Security mechanism
       2. HTTPS Client authentication. 
       3. Login Config element
       4. Declarative security
       5. HTTP Servlet method

M7 - Introduction to JSP (Giới thiệu về JSP)
       1. JSP Basi: overview of JSP
       2. JSP Lyfe Cycle: Translation, compilation, execution. 
       3. Elements of a JSP Page: expression, script let, declaration, comment, directive.
       4. Directive: page, include, taglib

M8 - JSP Implicit Object (Các đối tượng ẩn trong JSP - đối tượng được khai báo sẵn)
       1. JSP Implicit Obj: input and output, scope communication, servlet obj, Error obj.
       2. Input and output: request, response, out.
       3. Scope communication obj: session, application, pageComtext objs.
       4. Servlet Object: Page, Config objs
       5. Error Object: exception obj

M9 - Standard Action and JavaBean
       1. Standard action
       2. Java Bean
       3. Standard action in java Bean
       4. Java Bean and Scriptlet: how to use Bean in jsp tag and scriptlet.

M10- JSP Expression Language
       1. Expression Language (EL)
       2. EL implicit Object: PageContext, ServletContext, session, request.
       3. EL Operators: những toán tử mà EL hỗ trợ.
       4. Function using EL: Khai báo tag library description để sử dụng static method.
       5. Coercion: chuyển kiểu trong EL

Chúc các em ôn tập tốt.

Monday, June 28, 2010

Danh sách nhóm thực hiện e-project Batch 79A

1. Group 1:  Campaign information management
       Members:
          - Nguyễn Văn Hà (Lead)  - phone: 01684868452 - vietha_3000nd@yahoo.com
          - Đoàn Ngọc Duy
          - Lê Hồ Xuân Đạt
          - Ngô Sơn Bá        

2. Group 2:  Cross word
      Members:
          - Lê Khắc Việt(Lead)  -  Phone: 0902814363  - email: linhdan1@gmail.com
          - Lê Tấn Lĩnh
          - Huỳnh Kim Tài
          - Lý Văn Long      

3. Group 3:  Employ transfer management
        Members:
          - Hoàng Nguyễn Tam Anh(Lead)-phone: 0935005762 - tamanhtp@gmail.com
          - Hồ Hồng Nhật
          - Phạm Quang Phúc
          - Huỳnh Đức Hoàng     

4    Group 4: Expo management
         Members:
          - Tôn Thất Bá(Lead) -   phone: 0905200209  - email: baton1211@gmail.com
          - Nguyễn Đức Cương
          - Lê Vũ Đình Phong
          - Đoàn Quốc Cường   

Hướng dẫn tham chiếu và sử dụng JSP Standard Tag Library (JSTL) trong ứng dụng Web

Công nghệ JSP giúp LTV dễ dàng trong việc nhúng các mã java(scriptlets) vào trong các trang tài liệu HTML. Tuy nhiên, giải pháp này không tối ưu cho tất cả những LTV có ít kiến thức về Java, Java Servlet và JSP. Để tạo ra sự tiện lợi trong công việc phát triển web với JSP, chúng ta có thể tìm hiểu sử dụng JSTL 1.0 (hoặc 1.1) và mọi thứ thật đơn giản và tiện dụng. Khi sử dụng JSTL, tất cả các cú pháp làm việc từ cơ bản như khai báo biến, xuất giá trị, cấu trúc điều khiển,... đến truy vấn dữ liệu đều có thể sử dụng các dạng tab như HTML để đưa vào trang JSP. Công việc của LTV bây giờ chỉ là học cách sử dụng các tab này.
Ngoài ra, sử dụng jstl cũng là một cách sử dụng lại component đơn giản và tiện dụng. Tuy nhiên, các tag này đang trong giai đoạn phát triển và thử nghiệm.
Mình đã tiến hành cài đặt và sử dụng jstl để phát triển thử. Sau đây là cách thức cấu hình và sử dụng jstl:
- Loại hình ứng dụng: web application
- Ngôn ngữ sử dụng: java, JSP.
- Phiên bản:
               Servlet 2.3/JSP 1.2 + JSTL 1.0  
               Servlet 2.3/JSP 1.2 + JSTL 1.1 
               Servlet 2.4/JSP 2.0 + JSTL 1.1 
- Apache Tomcat  version 4. trở lên.
***Bạn đã sử dụng netbean để tạo 1 project web application. Trong project này, bạn chú ý đến các bước cấu hình xảy ra trong thư mục WEB-INF.
2. Sau khi down về máy, hãy giải nén file này và ta có 1 cấu trúc thư mục như sau:
3. Vào thư mục lib đó, bạn sẽ thấy 2 file: jstl.jar và standard.jar. Chép 2 file này đến thư mục lib trong WEB-INF vừa nói ở trên. (Nếu muốn dùng các tab lib khác thì có thể chép toàn bộ thư mục lib vào).
4. Trong project đã tạo, bạn hãy nhấn vào tên project rồi ấn chuột phải và chọn: Properties >> Libraries tab: chọn thêm jar file và chọn đến 2 file trong thư viện  jstl.jar, standard.jar  >> OK.
5. Bây giờ bạn hãy tạo mới 1 trang jsp và sử dụng custom tag vừa cấu hình:
* Chú ý: đầu trang ta khai báo sử dụng tag như sau:
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
* Sau đó quá trình viết mã cho trang jsp thật đơn giản. Ví dụ sau về lệnh switch-case
6. Một số lưu ý:
** Bạn có thể khai báo uri ở trang jsp như sau:
 - JSTL1.0    : uri="http://java.sun.com/jstl/core"
 - JSTL1.0-rt : uri="http://java.sun.com/jstl/core_rt"
 - JSTL1.1     : uri="http://java.sun.com/jsp/jstl/core"
** Ngoài ra ở file web.xml trong thư mục WEB-INF, chú ý dòng thứ 2 sẽ là:

Version từ 2.3 trở lên.
Có thể tham khảo thêm tại:
http://java.sun.com/developer/technicalArticles/javaserverpages/faster/
http://www.mularien.com/blog/2008/04/24/how-to-reference-and-use-jstl-in-your-web-application/

Tuesday, June 22, 2010

Assignment 1 - Topic on Servlet

Chào batch 04b,

       Hôm nay về nhà mọi người cần làm công việc sau: hãy xem hình ảnh mô tả
       Tạo CSDL trong SQL Server hoặc MySQL:


      
Mọi người nhìn hình vẽ mô tả và viết các Servlet để làm việc tương ứng.

Review- Topic on Servlet 1

Chào các bạn batch04b,
        Lớp mình đã học xong phần đầu về Servlet. Trong phần này mình hy vọng mọi người cần nắm các chủ đề sau:
     1.  Module 1: CGI, Dynamic and Static Website.
     2.  Module 2: Browse, HttpServletrequest, HttpServletresponse, JavaServer Face, Servlet Life Cycle.
     3. Module 3: Error Status, RequestDispatcher, Servlet API Documentation
     4. Module 4: Http Session Problem, Session traking using Cookies, Session tracking
     5. Module 5: Applet Servlet Communication, Compessing the response, Simple Filter, Inter-Servlet communication, Manipulating the response, Parameterize Filter, Servlet and JSP Filter.

    *** Một điều cực kỳ quan trọng, mọi người cần phải hoàn thành 5 bài lab theo giáo trình. Trong bài Lab, mọi người cần nắm các bước thực hiện, ý nghĩa của việc sử dụng các Class, Interface, methods. Nếu có gì không hiểu nên đánh dấu lại để lên lớp trao đổi.

Chúc mọi người học tốt!

Friday, May 28, 2010

Thông báo về thi Hệ Phân Tán

Chào SV lớp 09TLT,
        Theo lịch thi của lớp sẽ thi môn HPT vào ngày 31/05/2010 ở Khu H. Nay chuyển sang phòng máy (phòng hôm trước lớp thực hành) để bảo vệ bài tập lớn.
        Thời gian: ngày 31/05.2010 - sáng 7h30. Chiều 1h30.
        Mọi người nhớ chuẩn bị tốt để báo cáo thành công. Các nhóm cần chuẩn bị document báo cáo, slides báo cáo (10 slides), Máy Laptop đã cài đặt sẵn chương trình, mã nguồn chép sẵn để ghi ra đĩa CD (tập hợp lại để lớp trưởng ghi).

       Chúc mọi người chuẩn bị tốt và bảo vệ thành công.

Tuesday, April 13, 2010

Book on Scheduling in Distributed System

Hi all,
      The students who are making report on Scheduling in Distributed System can download this book, then follow this document to accomplish their task. I hope this is a useful material which have a main role in your good result.
     Please follow below link to download the book.
Book on Scheduling in Distributed System
     Try your best, the success is waiting for you! keep going on.

Monday, April 5, 2010

Tuesday, March 30, 2010

Saturday, March 27, 2010

CLASSPATH

Setting the Classpath

The JDBC driver is not part of the Java SDK, so you must set the classpath to include the sqljdbc.jar file if you want to use it. If the classpath is missing an entry for sqljdbc.jar, your application will throw the common "Class not found" exception.
The sqljdbc.jar file is installed in the following location:
\sqljdbc_1.0\\sqljdbc.jar

The following is an example of the CLASSPATH statement used for a Windows application:
CLASSPATH =.;C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.0\enu\sqljdbc.jar
The following is an example of the CLASSPATH statement used for a Unix/Linux application:
CLASSPATH =.;/home/usr1/mssqlserver2005jdbc/Driver/sqljdbc_1.0/enu/sqljdbc.jar
Note: On Window systems, directory names longer than 8.3 or folder names with spaces can cause problems with classpaths. If you suspect these types of issues, you should temporarily move the sqljdbc.jar file into a simple directory name such as C:\Temp, change the classpath, and determine whether that addresses the problem.
Applications that are run directly at the command prompt
The classpath is configured in the operating system. Append sqljdbc.jar to the system's classpath. Alternatively, you can specify the classpath on the Java command line that runs the application by using the java -classpath option.
The application runs within the IDE
Each IDE vendor has a different method to set the classpath within their IDE. Just setting the classpath in the operating system will not work. You must add sqljdbc.jar to the IDE classpath.
Servlet or JSP
Servlets and JSPs are run within a servlet/JSP engine such as Tomcat. The classpath must be set according to the servlet/JSP engine documentation. Just setting the classpath in the operating system will not work. Some servlet/JSP engines provide setup screens that you can use to set the classpath of the engine. In that situation, you must append the correct JDBC Driver JAR file to the existing engine classpath and restart the engine. In other situations, you can deploy the driver by copying sqljdbc.jar to a specific directory, such as lib, during engine installation. The engine driver classpath can also be specified in an engine specific configuration file.
Enterprise Java Beans
Enterprise Java Beans (EJB) are run within an EJB container. EJB containers are sourced from various vendors. Java applets run within a browser but they are downloaded from a Web server. Copy sqljdbc.jar to the Web server root and specify the name of the JAR file in the applet's HTML archive tab.
Making a Simple Connection to a Database
To connect to a database by using the DriverManager class, you must first register the driver as in the following:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
When the driver is loaded, you can establish a connection by using a connection URL:
Connection con = DriverManager.getConnection("jdbc:sqlserver://localhost;user=MyUserName;password=*****");

Thursday, March 18, 2010

Driver SQL Server 2005

Hi All,
Minh gui moi nguoi driver de ket noi CSDL SQL Server 2005. http://www.mediafire.com/?yttnnzmmnmx

Java RMI Example

Hi all,
Moi nguoi download vi du ve RMI ma minh da lam tren lop. Tai ve duas vao trong netbean va chay nhu o tren lop minh da lam.
http://www.mediafire.com/?mno1zyz0nzw

Tuesday, February 23, 2010

Topics on Distributed System

Hi all,
This is the Link which you can download the list of topics on DS to make reporting. I hope all Students can get this document, then you quickly choose a topic to report.
Notes: The monitor give me a sheet of students as well as the topic which that student choose!

Good luck!

Thong bao nghi buoi hoc bu chieu thu 5

Chào các bạn 09TLT,
Buổi học bù vào chiều thứ 5 tuần này sẽ hủy do mình bận việc đột xuất. Mình mong mọi người thông cảm. Mình sẽ thông báo học bù lại sau.

Saturday, February 13, 2010

Thursday, January 28, 2010

Granny, I love you so much!

Going home.
It is the most catastrophic day to me when i received an income call which inform about my granny. she leaved me to come to another world that i will never meet her again. All my memories about my paternal grandmother suddenly appeared to my mind. I reminisced the marvelous time when i was lived with her. My tears from eyes dropped down to my lips but i could not taste it. My happy childhood, which i am sure that i never forget, is mainly about the time living with her.
I hope and pray that my best granny will be gone to heaven where she absolutely has a happier life.
Where my granny? I love you. hic.

Monday, January 4, 2010

Some excellent books about Distributed Computing

I took a long time to search the famous book with title: "Distributed System: Concepts and paradigms". How lucky i am! Thank God, i finally found it. I would like to upload to this page in order to share with other people who are studying at Distributed System or concerned people.
I hope you will have the best result of your study.
This is a Link to download:
DS: Concepts and paradigms