TAILIEUCHUNG - Core Servlets and JavaServer Pages phần 4

Mô tả một mục danh mục lưu trữ trực tuyến. ItemID xác định duy nhất các mục, mô tả ngắn gọn cho biết ngắn gọn như tiêu đề cuốn sách và tác giả, mô tả dài mô tả các mục trong một vài câu, vàBao gồm các tập tin và Applet trong tài liệu JSP | Prentice Hall and Sun Microsystems. Personal use only do not redistribute. Chapter 7 Generating the Server Response HTTP Response Headers Listing package coreservlets import . import Creates a Vector of large prime numbers usually in a low-priority background thread. Provides a few small thread-safe access methods. public class PrimeList implements Runnable private Vector primesFound private int numPrimes numDigits Finds numPrimes prime numbers each of which are numDigits long or longer. You can set it to only return when done or have it return immediately and you can later poll it to see how far it has gotten. public PrimeList int numPrimes int numDigits boolean runInBackground Using Vector instead of ArrayList to support JDK servlet engines primesFound new Vector numPrimes numPrimes numDigits i f runInBackground Thread t new Thread this Use low priority so you don t slow down server. else run public void run BigInteger start numDigits for int i 0 i numPrimes i start start synchronized this start public synchronized boolean isDone return numPrimes Home page for this book Home page for sequel . Servlet and JSP training courses by book s author . Prentice Hall and Sun Microsystems. Personal use only do not redistribute. Persistent Servlet State and Auto-Reloading Pages Listing continued public synchronized Vector getPrimes if isDone return primesFound else return Vector public int numDigits return numDigits public int numPrimes return numPrimes public synchronized int numCalculatedPrimes return Listing package coreservlets import A few utilities to generate a large random BigInteger and find the next prime number .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.