關鍵詞:
傳說中的100句背7000單詞 ?? ??????????????????????????????????????
傳說中的100句背7000單詞!
1. Typical of the grassland dwellers of the continent is the American antelope, or pronghorn.
1.美洲羚羊,或稱叉角羚,是該大陸典型的草原動物。
2. Of the millions who saw Haley’s comet in 1986, how many people will live long enough to see it return in the twenty-first century.
2. 1986年看見哈雷慧星的千百萬人當中,有多少人能夠長壽到足以目睹它在二十一世紀的回歸呢?
3. Anthropologists have discovered that fear, happiness, sadness, and surprise are universally reflected in facial expressions.
3.人類學家們已經發現,恐懼,快樂,悲傷和驚奇都會行之于色,這在全人類是共通的。
????? 4. Because of its irritating effect on humans, the use of phenol as a general antiseptic has been largely discontinued.
4.由于苯酚對人體帶有刺激性作用,它基本上已不再被當作常用的防腐劑了。
5. In group to remain in existence, a profit-making organization must, in the long run, produce something consumers consider useful or desirable.
5.任何盈利組織若要生存,最終都必須生產出消費者可用或需要的產品。
6. The greater the population there is in a locality, the greater the need there is for water, transportation, and disposal of refuse.
6.一個地方的人口越多,其對水,交通和垃圾處理的需求就會越大。
7. It is more difficult to write simply, directly, and effectively than to employ flowery but vague expressions that only obscure one’s meaning.
7.簡明,直接,有力的寫作難于花哨,含混而意義模糊的表達。
8. With modern offices becoming more mechanized, designers are attempting to personalize them with warmer, less severe interiors.
8.隨著現代辦公室的日益自動化,設計師們正試圖利用較為溫暖而不太嚴肅的內部裝飾來使其具有親切感。
9. The difference between libel and slander is that libel is printed while slander is spoken.
9.誹謗和流言的區別在于前者是書面的,而后者是口頭的。
10. The knee is the joints where the thigh bone meets the large bone of the lower leg.
10.膝蓋是大腿骨和小腿脛的連接處。
11. Acids are chemical compounds that, in water solution, have a sharp taste, a corrosive action on metals, and the ability to turn certain blue vegetable dyes red.
11.酸是一種化合物,它在溶于水時具有強烈的氣味和對金屬的腐蝕性,并且能夠使某些藍色植物染料變紅。
12. Billie Holiday’s reputation as a great jazz-blues singer rests on her ability to give emotional depth to her songs.
12. Billie Holiday’s作為一個爵士布魯斯樂杰出歌手的名聲建立在能夠賦予歌曲感情深度的能力。
13. Essentially, a theory is an abstract, symbolic representation of what is conceived to be reality.
13.理論在本質上是對認識了的現實的一種抽象和符號化的表達。
14. Long before children are able to speak or understand a language, they communicate through facial expressions and by making noises.
14.兒童在能說或能聽懂語言之前,很久就會通過面部表情和靠發出噪聲來與人交流了。
15. Thanks to modern irrigation, crops now grow abundantly in areas where once nothing but cacti and sagebrush could live.
15.受當代灌溉(技術設施)之賜,農作物在原來只有仙人掌和蕎屬科植物才能生存的地方旺盛的生長。
16. The development of mechanical timepieces spurred the search for more accurate sundials with which to regulate them.
16.機械計時器的發展促使人們尋求更精確的日晷,以便校準機械計時器。
17. Anthropology is a science in that anthropologists use a rigorous set of methods and techniques to document observations that can be checked by others.
17.人類學是一門科學,因為人類學家采用一整套強有力的方法和技術來記錄觀測結果,而這樣記錄下來的觀測結果是供他人核查的。
18. Fungi are important in the process of decay, which returns ingredients to the soil, enhances soil fertility, and decomposes animal debris.
18.真菌在腐化過程中十分重要,而腐化過程將化學物質回饋于土壤,提高其肥力,并分解動物糞便。
19. When it is struck, a tuning fork produces an almost pure tone, retaining its pitch over a long period of time.
19.音叉被敲擊時,產生幾乎純質的音調,其音量經久不衰。
20. Although pecans are most plentiful in the southeastern part of the United States, they are found as far north as Ohio and Illinois.
20.雖然美洲山河桃樹最集中于美國的東南部但是在北至俄亥俄州及伊利諾州也能看見它們。
21. Eliminating problems by transferring the blame to others is often called scape-goating.
21.用怪罪別人的辦法來解決問題通常被稱為尋找替罪羊。
22. The chief foods eaten in any country depend largely on what grows best in its climate and soil.
22.一個國家的主要食物是什么,大體取決于什么作物在其天氣和土壤條件下生長得最好。
23. Over a very large number of trials, the probability of an event’s occurring is equal to the probability that it will not occur.
23.在大量的實驗中,某一事件發生的幾率等于它不發生的幾率。
24. Most substance contract when they freeze so that the density of a substance’s solid is higher than the density of its liquid.
24.大多數物質遇冷收縮,所以他們的密度在固態時高于液態。
25. The mechanism by which brain cells store memories is not clearly understood.
25.大腦細胞儲存記憶的機理并不為人明白。
26. By the middle of the twentieth century, painters and sculptors in the United States had begun to exert a great worldwide influence over art.
26.到了二十一世紀中葉,美國畫家和雕塑家開始在世界范圍內對藝術產生重大影響。
27. In the eastern part of New Jersey lies the city of Elizabeth, a major shipping and manufacturing center.
27.伊麗莎白市,一個重要的航運和制造業中心,坐落于新澤西州的東部。
28. Elizabeth Blackwell, the first woman medical doctor in the United States, founded the New York Infirmary, an institution that has always had a completely female medical staff.
28. Elizabeth Blackwell,美國第一個女醫生,創建了員工一直為女性紐約診所。
29. Alexander Graham Bell once told his family that he would rather be remembered as a teacher of the deaf than as the inventor of the telephone.
29. Alexander Graham Bell曾告訴家人,他更愿意讓后人記住他是聾子的老師,而非電話的發明者。
30. Because its leaves remain green long after being picked, rosemary became associated with the idea of remembrance.
30.采摘下的迷迭香樹葉常綠不衰,因此人們把迷迭香樹與懷念聯系在一起。
31. Although apparently rigid, bones exhibit a degree of elasticity that enables the skeleton to withstand considerable impact.
31.骨頭看起來是脆硬的,但它也有一定的彈性,使得骨骼能夠承受相當的打擊。
32. That xenon could not FORM chemical compounds was once believed by scientists.
32.科學家曾相信:氙氣是不能形成化合物的。
33. Research into the dynamics of storms is directed toward improving the ability to predict these events and thus to minimize damage and avoid loss of life.
33.對風暴動力學的研究是為了提高風暴預測從而減少損失,避免人員傷亡。
34. The elimination of inflation would ensure that the amount of money used in repaying a loan would have the same value as the amount of money borrowed.
34.消除通貨膨脹應確保還貸的錢應與所貸款的價值相同。
35. Futurism, an early twentieth-century movement in art, rejected all traditions and attempted to glorify contemporary life by emphasizing the machine and motion.
35.未來主義,二十世紀早期的一個藝術思潮。拒絕一切傳統,試圖通過強調機械和動態來美化生活。
36. One of the wildest and most inaccessible parts of the United States is the Everglades where wildlife is abundant and largely protected.
36. Everglades是美國境內最為荒涼和人跡罕至的地區之一,此處有大量的野生動植物而且大多受(法律)保護。
37. Lucretia Mott's influence was so significant that she has been credited by some authorities as the originator of feminism in the United States.
37. Lucretia Mott's的影響巨大,所以一些權威部門認定她為美國女權運動的創始人。
38. The activities of the international marketing researcher are frequently much broader than those of the domestic marketer.
38.國際市場研究者的活動范圍常常較國內市場研究者廣闊。
39. The continental divide refers to an imaginary line in the North American Rockies that divides the waters flowing into the Atlantic Ocean from those flowing into the Pacific.
39.大陸分水嶺是指北美洛磯山脈上的一道想象線,該線把大西洋流域和太平洋流域區分開來。
40. Studies of the gravity field of the Earth indicate that its crust and mantle yield when unusual weight is placed on them.
40.對地球引力的研究表明,在不尋常的負荷之下地殼和地幔會發生位移。
41. The annual worth of Utah's manufacturing is greater than that of its mining and farming combined.
41.尤它州制造業的年產值大于其工業和農業的總和。
42. The wallflower is so called because its weak stems often grow on walls and along stony cliffs for support.
42.墻花之所以叫墻花,是因為其脆弱的枝干經常要靠墻壁或順石崖生長,以便有所依附。
43. It is the interaction between people, rather than the events that occur in their lives, that is the main focus of social psychology.
43.社會心理學的主要焦點是人與人之間的交往,而不是他們各自生活中的事件。
44. No social crusade aroused Elizabeth Williams' enthusiasm more than the expansion of educational facilities for immigrants to the United States.
44.給美國的新移民增加教育設施比任何社會運動都更多的激發了Elizabeth Williams的熱情。
45. Quails typically have short rounded wings that enable them to spring into full flight instantly when disturbed in their hiding places.
45.典型的鵪鶉都長有短而圓的翅膀,憑此他們可以在受驚時一躍而起,飛離它們的躲藏地。
46. According to anthropologists, the earliest ancestors of humans that stood upright resembled chimpanzees facially, with sloping foreheads and protruding brows.
46.根據人類學家的說法,直立行走的人的鼻祖面部輪廓與黑猩猩相似,額頭后傾,眉毛突出。
47. Not until 1866 was the fully successful transatlantic cable finally laid.
47.直到1866年第一條橫跨大西洋的電纜才完全成功的架通。
48. In his writing, John Crowe Ransom describes what he considers the spiritual barrenness of society brought about by science and technology.
48. John Crowe Ransom在他的著作中描述了他認為是由科學技術給社會帶來的精神貧困。
49. Children with parents whose guidance is firm, consistent, and rational are inclined to possess high levels of self-confidence.
49.父母的教導如果堅定,始終如一和理性,孩子就有可能充滿自信。
50. The ancient Hopewell people of North America probably cultivated corn and other crops, but hunting and gathering were still of critical importance in their economy.
50.北美遠古的Hopewell人很可能種植了玉米和其他農作物,但打獵和采集對他們的經濟貿易仍是至關重要的。
51. Using many symbols makes it possible to put a large amount of inFORMation on a single map.
51.使用多種多樣的符號可以在一張地圖里放進大量的信息。
52. Anarchism is a term describing a cluster of doctrines and attitudes whose principal uniting feature is the belief that government is both harmful and unnecessary.
52.無政府主義這個詞描述的是一堆理論和態度,它們的主要共同點在于相信政府是有害的,沒有必要的。
53. Probably no man had more effect on the daily lives of most people in the Untied States than did Henry Ford a pioneer in automobile production.
53.恐怕沒有誰對大多數美國人的日常生活影響能超過汽車生產的先驅亨利.福特。
54. The use of well-chosen nonsense words makes possible the testing of many basic hypotheses in the field of language learning.
54.使用精心挑選的無意義詞匯,可以檢驗語言學科里許多基本的假定。
55. The history of painting is a fascinating chain of events that probably began with the very first pictures ever made.
55.優化歷史是由一連串的迷人事件組成,其源頭大概可以上溯到最早的圖畫。
56. Perfectly matched pearls, strung into a necklace, bring a far higher price than the same pearls told individually.
56.相互般配的珍珠,串成一條項鏈,就能賣到比單獨售出好得多的價錢。
57. During the eighteenth century, Little Turtle was chief of the Miami tribe whose territory became what is now Indiana and Ohio.
57.十八世紀時,"小烏龜"是邁阿密部落的酋長,該部落的地盤就是今天的印第安那州和俄亥俄州。
58. Among almost seven hundred species of bamboo, some are fully grown at less than a foot high, while others can grow three feet in twenty-four hours.
58.在竹子的近七百個品種中,有的全長成還不到一英尺,有的卻能在二十四小時內長出三英尺。
59. Before staring on a sea voyage, prudent navigators learn the sea charts, study the sailing directions, and memorize lighthouse locations to prepare themselves for any conditions they might encounter.
59.謹慎的航海員在出航前,會研究航向,記錄的燈塔的位置,以便對各種可能出現的情況做到有備無患。
60. Of all the economically important plants, palms have been the least studied.
60.在所有的經濟作物中,棕櫚樹得到的研究最少。
61. Buyers and sellers should be aware of new developments in technology can and does affect marketing activities.
61.購買者和銷售者都應該留意技術的新發展,原因很簡單,因為技術能夠并且已經影響著營銷活動。
62. The application of electronic controls made possible by the microprocessor and computer storage have multiplied the uses of the modern typewriter.
62.電腦儲存和由于電子微處理機得以實現的電控運用成倍的增加了現代打字機的功能。
63. The human skeleton consists of more than two hundred bones bound together by tough and relatively inelastic connective tissues called ligaments.
63.人類骨骼有二百多塊骨頭組成,住些骨頭石油堅韌而相對缺乏彈性的,被稱為韌帶的結蒂組連在一起。
64. The pigmentation of a pearl is influenced by the type of oyster in which it develops and by the depth, temperature, and the salt content of the water in which the oyster lives.
64.珍珠的色澤受到作為其母體牡蠣種類及牡蠣生活水域的深度,溫度和含鹽度的制約。
65. Although mockingbirds superbly mimic the songs and calls of many birds, they can nonetheless be quickly identified as mockingbirds by certain aural clues.
65.盡管模仿鳥學很多種鳥的鳴叫聲惟妙惟肖,但人類還是能夠依其聲音上的線索很快識別它們。
66. Not only can walking fish live out of water, but they can also travel short distances over land.
66.鲇魚不僅可以離開水存活,還可以在岸上短距離移動。
67. Scientists do not know why dinosaurs became extinct, but some theories postulate that changers in geography, climate, and sea levels were responsible.
67.科學家不知道恐龍為何絕種了,但是一些理論推斷是地理,氣候和海平面的變化造成的。
68. The science of horticulture, in which the primary concerns are maximum yield and superior quality, utilizes inFORMation derived from other sciences.
68.主要目的在于豐富和優質的農藝學利用了其他科學的知識。
69. Snow aids farmers by keeping heart in the lower ground levels, thereby saving the seeds from freezing.
69.雪對農民是一種幫助,因為它保持地層土壤的溫度,使種子不致凍死。
70. Even though the precise qualities of hero in literary words may vary over time, the basic exemplary function of the hero seems to remain constant.
70.歷代文學作品中的英雄本色雖各有千秋,但其昭世功力卻是恒古不變的。
71. People in prehistoric times created paints by grinding materials such as plants and clay into power and then adding water.
71.史前的人們制造顏料是將植物和泥土等原料磨成粉末,然后加水。
72. Often very annoying weeds, goldenrods crowd out less hardy plants and act as hosts to many insect pests.
72.黃菊花通常令人生厭,它擠走不那么頑強的植物,并找來很多害蟲。
73. Starting around 7000 B.C., and for the next four thousand years, much of the Northern Hemisphere experienced temperatures warmer than at present.
73.大約從公元前七千年開始,在四千年當中,北半球的溫度比現在高。
74. When Henry Ford first sought financial backing for making cars, the very notion of farmers and clerks owning automobiles was considered ridiculous.
74.當亨利.福特最初制造汽車為尋求資金支持時,農民和一般職員也能擁有汽車的想法被認為是可笑的。
75. Though once quite large, the population of the bald eagle across North America has drastically declined in the past forty years.
75.北美禿頭鷹的數量一度很多,但在近四十年中全北美的禿頭鷹數量急劇下降。
76. The beaver chews down trees to get food and material with which to build its home.
76.水獺啃倒樹木,以便取食物并獲得造窩的材料。
77. Poodles were once used as retrievers in duck hunting, but the American Kennel Club does not consider them sporting dogs because they are now primarily kept as pets.
77.長卷毛狗曾被用作獵鴨時叼回獵物的獵犬,但是美國Kennel Club卻不承認它們為獵犬,因為它們現在大多數作為寵物飼養。
78. As a result of what is now know in physics and chemistry, scientists have been able to make important discoveries in biology and medicine.
78.物理學和化學的一個成果是使得科學家們能在生物學和醫學上獲得重大發現。
79. The practice of making excellent films based on rather obscure novels has been going on so long in the United States as to constitute a tradition.
79.根據默默無聞的小說制作優秀影片在美國由來已久,已經成為傳統。
80. Since the consumer considers the best fruit to be that which is the most attractive, the grower must provide products that satisfy the discerning eye.
80.因為顧客認為最好的水果應該看起來也是最漂亮的,所以種植者必須提供能滿足挑剔眼光的產品。
81. Television the most pervasive and persuasive of modern technologies, marked by rapid change and growth, is moving into a new era, an era of extraordinary sophistication and versatility, which promises to reshape our lives and our world.
81.電視,這項從迅速變化和成長為標志的最普及和最有影響力的現代技術,正在步入一個新時代,一個極為成熟和多樣化的時代,這將重塑我們的生活和世界。
82. Television is more than just an electronics; it is a means of expression, as well as a vehicle for communication, and as such becomes a powerful tool for reaching other human beings.
82.電視不僅僅是一件電器;它是表達的手段和交流的載體并因此成為聯系他人的有力工具。
83. Even more shocking is the fact that the number and rate of imprisonment have more than doubled over the past twenty years, and recidivism------that is the rate for re-arrest------is more than 60 percent.
83.更讓人吃驚的事實是監禁的數目和比例在過去的二十年中翻了一番還有余,以及累犯率——即再次拘押的比例——為百分之六十強。
84. His teaching began at the Massachusetts Institute of Technology, but William Rainey Harper lured him to the new university of Chicago, where he remained officially for exactly a generation and where his students in advanced composition found him terrifyingly frigid in the classroom but sympathetic and understanding in their personal conferences.
84.他的教書生涯始于麻省理工學院,但是William Rainey Harper把他吸引到了新成立的芝加哥大學。他在那里正式任職長達整整一代人的時間。他的高級作文課上的學生覺得他在課上古板得可怕,但私下交流卻富有同情和理解。
85. The sloth pays such little attention to its personal hygiene that green algae grow on its coarse hair and communities of a parasitic moth live in the depths of its coat producing caterpillars which graze on its mouldy hair. Its muscles are such that it is quits incapable of moving at a speed of over a kilometer an hour even over the shortest distances and the swiftest movement it can make is a sweep of its hooked arm.
85.樹獺即不講究衛生,以至于它粗糙的毛發上生出綠苔,成群的寄生蛾生長在它的皮毛深處,變成毛毛蟲,并以它的臟毛為食。她的肌肉不能讓他哪怕在很短的距離以內以每小時一公里的速度移動。它能做的最敏捷的動作就是揮一揮它彎曲的胳膊。
86. Artificial flowers are used for scientific as well as for decorative purposes. They are made from a variety of materials, such as way and glass, so skillfully that they can scarcely be distinguished from natural flowers.
86.人造花卉即可用于科學目的,也可用于裝飾目的,它們可以用各種各樣的材料制成,臂如蠟和玻璃;其制作如此精巧,幾乎可以以假亂真。
87. Three years of research at an abandoned coal mine in Argonne, Illinois, have resulted in findings that scientists believe can help reclaim thousands of mine disposal sites that scar the coal-rich regions of the United States.
87.在伊利諾州Angonne市的一個廢棄煤礦的三年研究取得了成果,科學家們相信這些成果可以幫助改造把美國產煤區弄得傷痕累累的數千個舊煤場。
88. When the persuading and the planning for the western railroads had finally been completed, the really challenging task remained: the dangerous, sweaty, backbreaking, brawling business of actually building the lines.
88.當有關西部鐵路的說服和規劃工作終于完成后,真正艱難的任務還沒有開始;即危險,吃力,需要傷筋動骨和吵吵嚷嚷的建造這些鐵路的實際工作。
89. Because of the space crunch, the Art Museum has become increasingly cautious in considering acquisitions and donations of art, in some cases passing up opportunities to strengthen is collections.
89.由于空間不足,藝術博物館在考慮購買和接受捐贈的藝術品是越來越慎重,有些情況下放棄其進一步改善收藏的機會。
90. The United States Constitution requires that President be a natural-born citizen, thirty-five years of age or older, who has lived in the United States for a minimum of fourteen years.
90.美國憲法要求總統是生于美國本土的公民,三十五歲以上,并且在美國居住了至少十四年。
91. Arid regions in the southwestern United States have become increasingly inviting playgrounds for the growing number of recreation seekers who own vehicles such as motorcycles or powered trail bikes and indulge in hill-climbing contests or in caving new trails in the desert.
91.美國西部的不毛之地正成為玩耍的地方,對越來越多擁有摩托車或越野單車類車輛的,喜歡放縱于爬坡比賽或開辟新的沙漠通道的尋歡作樂者具有不斷增長的吸引力。
92. Stone does decay, and so tools of long ago have remained when even the bones of the man who made them have disappeared without trace.
92.石頭不會腐爛,所以以前的(石器)工具能保存下來,雖然它們的制造者已經消失的無影無蹤。
93. Insects would make it impossible for us to live in the world; they would devour all our crops and kill our flocks and herds, if it were not for the protection we get from insect-eating animals.
93.昆蟲就將會使我們無法在這個世界上居住;如果我們沒有受到以昆蟲為食的動物的保護,昆蟲就會吞嚼掉我們所有的莊稼并殺死我們飼養的禽獸。
94. It is true that during their explorations they often faced difficulties and dangers of the most perilous nature, equipped in a manner which would make a modern climber shudder at the thought, but they did not go out of their way to court such excitement.
94.確實,他們在探險中遇到了極具威脅性的困難和危險,而他們的裝備會讓一個現代登山者想一想都會渾身顫栗。不過他們并不是刻意去追求刺激的。
95. There is only one difference between an old man and a young one: the young man has a glorious future before him and old one has a splendid future behind him: and maybe that is where the rub is.
95.老人和年輕人之間只有一個區別:年輕人的前面有輝煌的未來,老年人燦爛的未來卻已在它們身后。這也許就是困難之所在。
96. I find young people exciting. They have an air of freedom, and they have not a dreary commitment to mean ambitions or love comfort. They are not anxious social climbers, and they have no devotion to material things.
96.我們位年強人振奮。它們帶有自由的氣息,他們不會為狹隘的野心和貪婪享受而孜孜以求。他們不是焦慮的向上爬的人,他們不會對物質性的東西難舍難分。
97. I am always amazed when I hear people saying that sport creates goodwill between the nations, and that if only the common peoples of the world could meet one another at football or cricket, they would have no inclination to meet on the battlefield.
97.每次我聽說體育運動能夠在國家間建立起友好感情,說世界各地的普通人只要能在足球場或板球場上相遇就會沒有興趣在戰場上相遇的話,我都倍感詫異。
98. It is impossible to say simply for the fun and exercise: as soon as the question of prestige arises, as soon as you feel that you and some larger unit will be disgraced if you lose, the most savage combative instincts are around.
98.沒有可能僅僅為了娛樂或鍛煉而運動:一旦有了問題,一旦你覺得你輸了你和你所屬團體會有失體面時,你最野蠻的好斗本能就會被激發出來。
99. It has been found that certain bats emit squeaks and by receiving the echoes, they can locate and steer clear of obstacles------or locate flying insects on which they feed. This echo-location in bats is often compared with radar, the principle of which is similar.
99.人們已經發現,某些蝙蝠發出尖叫聲并靠接受回響來鎖定和避免障礙物——或者找到它們賴以為生的昆蟲。蝙蝠這種回響定位法常拿來和原理與之很相近似的雷達相比。
100. As the time and cost of making a clip drop to a few days and a few hundred dollars, engineers may soon be free to let their imaginations soar without being penalized by expensive failure.
100.隨著芯片制造時間和費用降低到了幾天和幾百美元,工程師們可能很快可以任他們的想象馳騁而不會被昂貴的失敗所懲罰。
posted @
2006-08-16 20:25 阿成 閱讀(266) |
評論 (0) |
編輯 收藏
摘要: 1. I see. 我明白了。2. I quit! 我不干了!3. Let go! 放手!4. Me too. 我也是。5. My god! 天哪!6. No way! 不行!7. Come on. 來吧(趕快)8. Hold on. 等一等。9. I agree。 我同意。10. Not bad. 還不錯。11. Not yet. 還沒。12. See you. 再見。13. Shut up! ...
閱讀全文
posted @
2006-08-16 20:24 阿成 閱讀(1543) |
評論 (0) |
編輯 收藏
概述
本手冊包含conf/server.xml文件中所有配置指示符(directives)的參考信息,這些指示符決定了Tomcat?5的行為。本手冊并不描述應該使用哪個配置指示符來完成特定的任務,請參考對應的HOW-TO文件。?
配置元素的描述按照如下主目錄來組織:
????頂級元素-是整個配置文件的根元素,而代表與一個引擎(Engine)相關聯的一組連接器(Connectors);?
????連接器(Connectors)-代表外部客戶之間的接口。外部客戶向特定的Service發送請求,并接收響應;?
????容器-代表一些組件。這些組件的功能是處理進來的請求,生成對應的響應。引擎(Engine)處理一個Service的所有請求,Host處理一個特定虛擬主機的所有請求。Context處理某個特定web應用的所有請求;?
????嵌入組件-代表可以嵌入容器的某個元素之中的元素。有些元素可以嵌入任何容器,而另一些元素只能嵌入在Context中。?
對每個元素,對應的文檔按照如下方式組織:?
概述-對這個特定組件的整體描述。每個組件在org.apache.catalina包中存在一個對應的Java接口,可能有一個或多個標準實現實現了這個接口;?
屬性-該元素的合法屬性。一般來說,這又分成公共屬性和標準實現屬性。公共屬性是所有實現了該Java接口的實現都具有的屬性。標準實現屬性是實現了該Java接口的某個特定Java類具有的屬性。必需的屬性用粗體標出;?
嵌套組件-列舉了可以合法地嵌在這個元素下的組件;?
專有特性-描述了該接口的標準實現支持的專有特性的配置,與每個元素類型有關;
頂級元素:Server??Service
連接器:HTTP/1.1??JK?
容器:Context??Engine??Host?
嵌套組件:
Default?Context?
Global?Resources?
Loader?
Logger?
Manager?
Realm?
Resources?
Valve?
posted @
2006-08-16 20:03 阿成 閱讀(266) |
評論 (0) |
編輯 收藏
Log4j基本使用方法
(轉http://blogger.org.cn/blog/more.asp?name=dashee&id=6431)
Log4j由三個重要的組件構成:日志信息的優先級,日志信息的輸出目的地,日志信息的輸出格式。日志信息的優先級從高到低有ERROR、WARN、
INFO、DEBUG,分別用來指定這條日志信息的重要程度;日志信息的輸出目的地指定了日志將打印到控制臺還是文件中;而輸出格式則控制了日志信息的顯示內容。
一、定義配置文件
其實您也可以完全不使用配置文件,而是在代碼中配置Log4j環境。但是,使用配置文件將使您的應用程序更加靈活。Log4j支持兩種配置文件格式,一種是XML格式的文件,一種是Java特性文件(鍵=值)。下面我們介紹使用Java特性文件做為配置文件的方法:
1.配置根Logger,其語法為:
log4j.rootLogger
= [ level ] , appenderName, appenderName, …
其中,level
是日志記錄的優先級,分為OFF、FATAL、ERROR、WARN、INFO、DEBUG、ALL或者您定義的級別。Log4j建議只使用四個級別,優先級從高到低分別是ERROR、WARN、INFO、DEBUG。通過在這里定義的級別,您可以控制到應用程序中相應級別的日志信息的開關。比如在這里定義了INFO級別,則應用程序中所有DEBUG級別的日志信息將不被打印出來。
appenderName就是指B日志信息輸出到哪個地方。您可以同時指定多個輸出目的地。
2.配置日志信息輸出目的地Appender,其語法為:
log4j.appender.appenderName
=
fully.qualified.name.of.appender.class
log4j.appender.appenderName.option1
= value1
…
log4j.appender.appenderName.option =
valueN
其中,Log4j提供的appender有以下幾種:
org.apache.log4j.ConsoleAppender(控制臺),
org.apache.log4j.FileAppender(文件),
org.apache.log4j.DailyRollingFileAppender(每天產生一個日志文件),
org.apache.log4j.RollingFileAppender(文件大小到達指定尺寸的時候產生一個新的文件),
org.apache.log4j.WriterAppender(將日志信息以流格式發送到任意指定的地方)
3.配置日志信息的格式(布局),其語法為:
log4j.appender.appenderName.layout
=
fully.qualified.name.of.layout.class
log4j.appender.appenderName.layout.option1
= value1
…
log4j.appender.appenderName.layout.option =
valueN
其中,Log4j提供的layout有以e幾種:
org.apache.log4j.HTMLLayout(以HTML表格形式布局),
org.apache.log4j.PatternLayout(可以靈活地指定布局模式),
org.apache.log4j.SimpleLayout(包含日志信息的級別和信息字符串),
org.apache.log4j.TTCCLayout(包含日志產生的時間、線程、類別等等信息)
Log4J采用類似C語言中的printf函數的打印格式格式化日志信息,打印參數如下:
%m 輸出代碼中指定的消息
%p 輸出優先級,即DEBUG,INFO,WARN,ERROR,FATAL
%r
輸出自應用啟動到輸出該log信息耗費的毫秒數
%c 輸出所屬的類目,通常就是所在類的全名
%t 輸出產生該日志事件的線程名
%n
輸出一個回車換行符,Windows平臺為“\r\n”,Unix平臺為“\n”
%d
輸出日志時間點的日期或時間,默認格式為ISO8601,也可以在其后指定格式,比如:%d{yyy MMM dd
HH:mm:ss,SSS},輸出類似:2002年10月18日 22:10:28,921
%l
輸出日志事件的發生位置,包括類目名、發生的線程,以及在代碼中的行數。舉例:Testlog4.main(TestLog4.java:10)
二、在代碼中使用Log4j
1.得到記錄器
使用Log4j,第一步就是獲取日志記錄器,這個記錄器將負責控制日志信息。其語法為:
public
static Logger getLogger( String
name)
通過指定的名字獲得記錄器,如果必要的話,則為這個名字創建一個新的記錄器。Name一般取本類的名字,比如:
static
Logger logger = Logger.getLogger ( ServerWithLog4j.class.getName ()
)
2.讀取配置文件
當獲得了日志記錄器之后,第二步將配置Log4j環境,其語法為:
BasicConfigurator.configure
(): 自動快速地使用缺省Log4j環境。
PropertyConfigurator.configure ( String
configFilename) :讀取使用Java的特性文件編寫的配置文件。
DOMConfigurator.configure ( String
filename )
:讀取XML形式的配置文件。
3.插入記錄信息(格式化日志信息)
當上兩個必要步驟執行完畢,您就可以輕松地使用不同優先級別的日志記錄語句插入到您想記錄日志的任何地方,其語法如下:
Logger.debug
( Object message ) ;
Logger.info ( Object message ) ;
Logger.warn (
Object message ) ;
Logger.error ( Object message ) ;
posted @
2006-08-16 20:02 阿成 閱讀(241) |
評論 (0) |
編輯 收藏
摘要: 本文介紹
Java
Web Framework
的基本工作原理,和一些常用的開源
Web
MVC Framework(Struts, Web Work, Tapestry, Echo, JSF, Maverick, Spring MVC,
Turbine, Cocoon, Barracuda)
。
...
閱讀全文
posted @
2006-08-16 19:59 阿成 閱讀(178) |
評論 (0) |
編輯 收藏
SPAN 和 DIV 的區別在于,DIV(division)是一個塊級元素,可以包含段落、標題、表格,乃至諸如章節、摘要和備注等。而SPAN
是行內元素,SPAN 的前后是不會換行的,它沒有結構的意義,純粹是應用樣式,當其他行內元素都不合適時,可以使用SPAN。
效果:
<span>SPAN標記有一個重要而實用的特性,即它什么事也不會做,它的唯一目的就是圍繞你的HTML代碼中的其它元素,這樣你就可以為它們指定樣式了。在此例中,<span>標識符允許你將一個段落分成不同的部分。
還有一個標識符具有類似的功能,<div>DIV也被用來在HTML文件中建立邏輯部分。但與<div>SPAN不同,<div>工作于文本塊一級,它在它所包含的HTML元素的前面及后面都引入了行分隔。
posted @
2006-08-16 17:09 阿成 閱讀(268) |
評論 (0) |
編輯 收藏
隨著2005年Ajax這個名詞的流行,關于Ajax技術本身的爭論就一直喋喋不休。有些人為這種技術而激動,興奮得投入到
Ajax的大潮中。有些人對Ajax大為詬病,認為其不過是一種炒作,其類似技術早已實現,毫無新意。也有些人還持一種觀望的狀態,等到大勢所趨時,才進
行投入。
總之,一個新興事物的誕生之初,有不同的觀點進行爭論是很正常的現象。作者作為支持Ajax的一派,對這個新生事物,可以說是傾注了很多精
力。從最初的不懂,到略知一二,再到深刻認識,發現Ajax背后隱藏的趨勢,多少有些亢奮。憑此文,希望能夠把自己的觀點,表達一二。
Ajax在2005年異軍突起,伴隨著Web2.0,成為了本年度最為流行的名詞之一。很多人看到這樣一門技術,可能會很奇怪,感到很突兀。
- 為什么會突然產生這樣一種技術?
- 類似的技術早就有,Ajax有什么突破?
- 為什么這種技術如此盛行,并被某些人認為是一種趨勢呢?
如果你僅僅試圖從Ajax本身去尋找這些問
題的答案,你可能會一無所獲。如果你僅能夠看到Ajax本身,那就如同瞎子摸象、管中窺豹,不能領略全局,當然也不能領會其意義。相反,如果你能夠從一個
更好的高度上去思考Ajax所帶來的好處,把Ajax放到一個相關的語境中去體會,你就會有另一番發現。
與Ajax相連的,還有這么兩個名詞—RiA和Web2.0。
什么是RiA?
RiA就是Rich Internet Application的縮寫。
“Rich”代表功能強大,高交互性,高用戶體驗。
“Internet”代表方便。應用程序部署方便,用戶使用方便。跨系統,跨語言。
其實RiA實際上一種基于Web的C/S架構(我稱之為C/S/B)。由于有一個客戶端,所以RiA應用可以提供強大的功能,讓用戶體驗到高交互性,高
用戶體驗。同時,RiA又是基于Internet瀏覽器的應用,所以,用戶使用RiA非常方便。理想來說,用戶使用RiA應當像現在使用普通網頁一樣方
便。用戶不需要安裝任何的客戶端軟件,只要擁有瀏覽器。當用戶通過瀏覽器發出指令,希望運行某種RiA應用程序時,一切都會飛快的建立在客戶端機器上,就
像你在Web上點擊一個頁面一樣。
目前,典型的RiA的代表有如下幾種技術:
- MS ClickOnce
- Sun Java Web Start
- Adobe Flash
- Ajax
應該說,各大廠商均看到了RiA美好的未來,紛紛行動起來希望分一杯羹。只有Ajax技術在這些技術中有些特立獨行。
Ajax并不屬于任何廠商,相反,Ajax代表的是一種開源的風格。由于Ajax所采用的各種技術要么是基于標準的,要么也沒有被各大廠商所壟斷,所以
Ajax真正是一個平民化的技術,誰都可以用它。同時,由于Ajax采用的各種技術基于現有的瀏覽器,所以兼容性最好。用Ajax技術建立的網站,目前均
可以直接運行,不需要任何客戶端的改變。
其他的各種技術與Ajax比較起來,目前或多或少的還有些兼容性的問題。雖然這些技術功能強
大,但是目前它們應用起來還并不是很方便。不過可以看到,隨著時間的推進,相信,未來還是屬于功能更強大的一方。除非Ajax本身的功能有所加強。這樣,
就看Javascript的功力了。
RiA實際上代表的是一種回歸。
最開始流行的C/S結構,因為功能強大,而且范圍有限,不需要害怕部署問題。之后隨著用戶的增加,部署問題越來越大,導致B/S模式的產生。
B/S模式雖然功能有限,但是卻使用非常方便。從長期來看,方便的作用還是非常巨大的。功能可以不斷增強,但是如果不方便,將嚇走所有的客戶。實際上觀
察一下Web的發展,就會發現,如今百花齊放的Web開發技術,其目的都是為了提高B/S架構的交互性,讓他更能適應需要而已。
不過,
隨著目前越來越多的應用需要一直到Web上,人們終于發現B/S模式的缺點。各種技術上的硬性問題均限制著B/S模式的發展。從最基本的請求/相應模型,
HTTP協議,到所有負載均運行在服務器上的事實,讓我們迫切需要一種方式來提高Web的交互能力,但同時又不能喪失它的使用方便性。
于是,RiA誕生了。RiA就是基于瀏覽器的C/S結構。它將部分的服務器負載轉移到客戶端,同時又不會喪失使用和部署上的方便性。所以說,RiA就是一次回歸,只不過這次回歸我們沒有原地不動,相反,我們找到了最佳結合點。如圖1所示:

圖1、RiA就是一種回歸
但是,我們知道了RiA是一種回歸。可是,為什么RiA會盛行呢?這就需要我們把RiA放到Web2.0的環境中去思考。
什么是Web2.0?
目前,對于Web2.0并沒有明確的定義。在《What Is Web 2.0》這篇文章里,對Web2.0應用所需要具備的各種特點進行了總結,并且提了出來。
- Services, not packaged software, with cost-effective scalability
- Control over unique, hard-to-recreate data sources that get richer as more people use them
- Trusting users as co-developers
- Harnessing collective intelligence
- Leveraging the long tail through customer self-service
- Software above the level of a single device
- Lightweight user interfaces, development models, AND business models
雖然有這么多特性,但是Web2.0背后最本質的東西就只有兩點:
- 軟件向服務化發展,向平臺化發展
- Web由原來“Publisher”的觀點,發展成“Participation”的觀點。
正是基于這兩點,Web2.0時代迫切需要一種使用方便,高交互性的應用程序,而此重任,就落在了RiA身上。
通過圖2,你可以看到由Web1.0到Web2.0的變化。

圖2、Web1.0向Web2.0的演變
還是在《What Is Web 2.0》那篇文章里,勾勒出了一幅Web2.0的Meme
Map。這張圖的中心代表的是Web2.0的核心概念,而旁邊是Web2.0概念的延伸。在這張圖里,我試圖勾勒出一些迫切需要RiA的特征點。實際上,
你可以看到,在Web2.0的Meme Map里,到處充滿了RiA的倩影。如圖3所示:

圖3、Web2.0中的RiA倩影
看看大象本身
介紹了這么多,讓我們總結一下。
隨著軟件和互聯網的發展,需求導致一種新的計算模型出現。這種計算模型的特色就是,軟件逐漸的有前臺推向后臺,以平臺的方式提供服務,讓用戶在前臺表演。
計算模型的變化,導致Web2.0的出現。盡管僅僅是開始,但是,從Web2.0的身上你依然可以依稀看到這種變化的趨勢。不過Web2.0要想有如此變化,要想讓用戶參與進來,就必須提供一個用戶功能強大的,使用方便的用戶接口(UI)。
于是,需求導致了RiA的出現。RiA提供了一個滿足需求的用戶接口,使得大家可以參與到Web2.0中來。但是,RiA要想應用起來,可能還需要一個過程。
于是,幾種RiA技術中,目前使用起來最合適的Ajax凸現出來。正是由于Ajax出色的兼容性,讓他走到了歷史的前臺。有了它,我們開始了一場新的革命。
圖4顯示了這些名詞之間的關系。把它們放在一起看,也許你會發現不一樣的東西。

圖4、Ajax、RiA與Web2.0
未來的樣子
當我走在北京的街頭,我在想,如果我有一臺智能手機,可以訪問百度的map服務,也許我就不會像現在這樣擔心迷路了。實際上,類似的例子還有很多。如果Web2.0的明天已經到來,我們的生活會發生很多改變。
我不知道,盡管我很想知道。如果我真的能夠看到未來的樣子,再具備一些必要的執行力的話,也許我就是下一個比爾。不過,看到目前的這一點,已經令我非常興奮。不管怎么樣,我們都有權利想象。也有權利,用我們的手去改變世界。
怎么樣?開始吧?Let’s do it!
posted @
2006-08-16 17:09 阿成 閱讀(315) |
評論 (0) |
編輯 收藏
February 18, 2005
If
anything about current interaction design can be called “glamorous,”
it’s creating Web applications. After all, when was the last time you
heard someone rave about the interaction design of a product that
wasn’t on the Web? (Okay, besides the iPod.) All the cool, innovative
new projects are online.
Despite this, Web interaction
designers can’t help but feel a little envious of our colleagues who
create desktop software. Desktop applications have a richness and
responsiveness that has seemed out of reach on the Web. The same
simplicity that enabled the Web’s rapid proliferation also creates a
gap between the experiences we can provide and the experiences users
can get from a desktop application.
That gap is closing. Take a look at Google Suggest. Watch the way the suggested terms update as you type, almost instantly. Now look at Google Maps.
Zoom in. Use your cursor to grab the map and scroll around a bit.
Again, everything happens almost instantly, with no waiting for pages
to reload.
Google Suggest and Google Maps are two examples
of a new approach to web applications that we at Adaptive Path have
been calling Ajax. The name is shorthand for Asynchronous JavaScript +
XML, and it represents a fundamental shift in what’s possible on the
Web.
Defining Ajax
Ajax isn’t a technology.
It’s really several technologies, each flourishing in its own right,
coming together in powerful new ways. Ajax incorporates:
The
classic web application model works like this: Most user actions in the
interface trigger an HTTP request back to a web server. The server does
some processing — retrieving data, crunching numbers, talking to
various legacy systems — and then returns an HTML page to the client.
It’s a model adapted from the Web’s original use as a hypertext medium,
but as fans of The Elements of User Experience know, what makes the Web good for hypertext doesn’t necessarily make it good for software applications.
Figure 1: The traditional model for web applications (left) compared to the Ajax model (right).
This
approach makes a lot of technical sense, but it doesn’t make for a
great user experience. While the server is doing its thing, what’s the
user doing? That’s right, waiting. And at every step in a task, the
user waits some more.
Obviously, if we were designing the
Web from scratch for applications, we wouldn’t make users wait around.
Once an interface is loaded, why should the user interaction come to a
halt every time the application needs something from the server? In
fact, why should the user see the application go to the server at all?
How Ajax is Different
An
Ajax application eliminates the start-stop-start-stop nature of
interaction on the Web by introducing an intermediary — an Ajax engine
— between the user and the server. It seems like adding a layer to the
application would make it less responsive, but the opposite is true.
Instead
of loading a webpage, at the start of the session, the browser loads an
Ajax engine — written in JavaScript and usually tucked away in a hidden
frame. This engine is responsible for both rendering the interface the
user sees and communicating with the server on the user’s behalf. The
Ajax engine allows the user’s interaction with the application to
happen asynchronously — independent of communication with the server.
So the user is never staring at a blank browser window and an hourglass
icon, waiting around for the server to do something.
Figure
2: The synchronous interaction pattern of a traditional web application
(top) compared with the asynchronous pattern of an Ajax application
(bottom).
Every user action that normally would
generate an HTTP request takes the form of a JavaScript call to the
Ajax engine instead. Any response to a user action that doesn’t require
a trip back to the server — such as simple data validation, editing
data in memory, and even some navigation — the engine handles on its
own. If the engine needs something from the server in order to respond
— if it’s submitting data for processing, loading additional interface
code, or retrieving new data — the engine makes those requests
asynchronously, usually using XML, without stalling a user’s
interaction with the application.
Who’s Using Ajax
Google
is making a huge investment in developing the Ajax approach. All of the
major products Google has introduced over the last year — Orkut, Gmail, the latest beta version of Google Groups, Google Suggest, and Google Maps
— are Ajax applications. (For more on the technical nuts and bolts of
these Ajax implementations, check out these excellent analyses of Gmail, Google Suggest, and Google Maps.) Others are following suit: many of the features that people love in Flickr depend on Ajax, and Amazon’s A9.com search engine applies similar techniques.
These
projects demonstrate that Ajax is not only technically sound, but also
practical for real-world applications. This isn’t another technology
that only works in a laboratory. And Ajax applications can be any size,
from the very simple, single-function Google Suggest to the very
complex and sophisticated Google Maps.
At Adaptive Path,
we’ve been doing our own work with Ajax over the last several months,
and we’re realizing we’ve only scratched the surface of the rich
interaction and responsiveness that Ajax applications can provide. Ajax
is an important development for Web applications, and its importance is
only going to grow. And because there are so many developers out there
who already know how to use these technologies, we expect to see many
more organizations following Google’s lead in reaping the competitive
advantage Ajax provides.
Moving Forward
The
biggest challenges in creating Ajax applications are not technical. The
core Ajax technologies are mature, stable, and well understood.
Instead, the challenges are for the designers of these applications: to
forget what we think we know about the limitations of the Web, and
begin to imagine a wider, richer range of possibilities.
It’s going to be fun.
posted @
2006-08-16 17:08 阿成 閱讀(247) |
評論 (0) |
編輯 收藏
1、表單驗證,如何不提交就驗證,是通過鼠標選中其他輸入框表示前一個輸入框輸入完畢,就可以自動進行驗證。
2、http://www.chinaren.com/ 大家都去過吧,首頁頂部搜索條“學校、班機、同學、熱貼、網頁、音樂、圖片”這些標簽,點一個下面的內
容就換成與所點搜索項有關的,這是如何實現的呢?我要做這個功能
一.資源類網站
1,國內網站
1)Ajax中國(推薦)
一個專業的ajax技術網站,分類清晰,有大量的電子版教程,以及AJAX源碼下載!
www.okajax.com
2)ajaxcn.org
李琨老師的blog。李琨:《ajax實戰》譯者.
www.ajaxcn.org
3)www.ajaxw3c.com
2,國外網站
1)、Ajax的誕生
Ajax:ANewApproachtoWebApplications
www.adaptivepath.com/publications/essays/archives/000385.php
2)、AJAXMatters
www.ajaxmatters.com
關于Ajax技術一個信息量非常大的網站,有點像Ajax世界中的TSS。
3)、AJAXPatterns
與AJAX設計模式相關的資源。
www.ajaxpatterns.org
www.softwareas.com/ajax-patterns
4)、http://www.ajaxian.com
二.熱門文章
1.什么是AJAX
www.okajax.com/info/net/20060510.html
2.ajax技術簡介
www.okajax.com/info/basic/200604654.html
3.ajax.net
www.okajax.com/info/basic/200604556.html
www.okajax.com/info/tech/200605589.html
weblogs.asp.net/mschwarz/archive/2005/04/11/399893.aspx(英文)
三.ajax相關下載(電子書教程/源碼)
1.Ajax基礎教程電子版
www.okajax.com/info/bookdown/200604950.htm
2.《AJAX實戰》ajaxinaction電子版
www.okajax.com/info/bookdown/200604366.htm
3.AJAX開發簡略
www.okajax.com/info/bookdown/20060538.htm
4.AJAX版CD管理系統(jsp)
www.okajax.com/info/codedown/200604327.htm
5.Alexa查詢系統(Xmlhttp+Ajax)
www.okajax.com/info/codedown/200604982.htm
6.ASP.NET+AJAX解決網頁打開等待問題
www.okajax.com/info/codedown/200604166.htm
7.Ajax技術簡介(ajaxdemo)
www.okajax.com/info/codedown/200604576.htm
四.ajax相關圖書
1.《Ajax實戰》(目前Ajax領域最為全面深入的一本著作)
www.china-pub.com/computers/common/info.asp?id=28433
2.《Ajax基礎教程》(亞馬遜計算機榜首圖書,國內第1本Ajax圖書,中文pdf版)
http://www.devworld.cn/art2527.aspx
3.《Ajax修煉之道-Web2.0入門》(Ajax從小工到專家的首選圖書)
www.china-pub.com/computers/common/info.asp?id=29430
4.《征服Ajax+Lucene構建搜索引擎》
www.china-pub.com/computers/common/info.asp?id=29996
5.《征服Ajax--Web2.0快速入門與項目實踐(.net)》
www.china-pub.com/computers/common/info.asp?id=29995
6.《Ajax開發精要--概念、案例與框架》
www.china-pub.com/computers/common/info.asp?id=30006
7.AJAX——新手快車道
???????????
http://www.sp1.cn/ajax/info/bookdown/200605663.htm
8,Ajax 探密 (Ajax Hacks )
http://www.sp1.cn/ajax/info/bookdown/20060540.htm
9.Ajax基礎教程電子版
???????????
http://wh.wlha.com.cn/bbs/pic/ajaxbasic.rar
???????????????
五.部分技術文章
www.dragonson.com/doc/ajax.html
Ajax內部交流文檔
info96.k12studio.com/~nio/comments.php?id=242_0_1_0_C
簡單地對Ajax進行描述介紹
www.adaptivepath.com/publications/essays/archives/000385.php
Ajax:ANewApproachtoWebApplications
jibbering.com/2002/4/httprequest.html
UsingtheXMLHTTPRequestobject
developer.apple.com/internet/webcontent/xmlhttpreq.html
DynamicHTMLandXML:TheXMLHttpRequestObject
del.icio.us/popular/ajax
www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples
XMLHttpRequest&AjaxWorkingExamples
www.xml.com/lpt/a/2005/02/09/xml-http-request.html
VeryDynamicWebInterfaces
www.standards-schmandards.com/index.php?2005/03/01/16-ajax-and-accessibility
AJAXandAccessibility
www.xml.com/lpt/a/2005/05/11/ajax-error.html
ErrorsandAJAX
www.softwareas.com/ajax-patterns
AJAXPatterns:DesignPatternsforAJAXUsability
www.backbase.com/download/Whitepaper%20Backbase%20AJAX%20and%20Beyond.pdf
WhitepaperBackbaseAJAXandBeyond
www.ajaxpatterns.org/index.php?title=Main_Page
AJAXpatterns
www.onlamp.com/pub/a/onlamp/2005/05/19/xmlhttprequest.html
六、補充內容
在增加一個,有些基礎教程,雖然不多,但是都蠻有用的!
http://www.sp1.cn/ajax/info/basic/index.htm?
Ajax & XMLHttpRequset
http://tech.acnow.net/Html/Web/ASP/ASP_Skill/2006-6/15/163322869.shtml
了解Ajax框架
http://kb.csdn.net/java/Articles/200606/0964add7-c017-484e-9652-5d85030222c5.html?
標題 實現無刷新閃爍二級聯動下拉菜單
http://www.seaskyer.net/Index/Catalog11/266.html
標題 Ajax研究小結
http://www.seaskyer.net/Index/Catalog11/224.html
posted @
2006-08-16 17:08 阿成 閱讀(298) |
評論 (0) |
編輯 收藏
首先了解一下什么時DWR(Direct Web Remoting )
??
?DWR 是一個開放源碼的使用 Apache 許可協議的解決方案,它包含服務器端 Java 庫、一個 DWR servlet 以及
JavaScript 庫。雖然 DWR 不是 Java 平臺上唯一可用的 Ajax-RPC 工具包,但是它是最成熟的,而且提供了許多有用的功能。
???
從最簡單的角度來說,DWR 是一個引擎,可以把服務器端 Java 對象的方法公開給 JavaScript 代碼。使用 DWR
可以有效地從應用程序代碼中把 Ajax 的全部請求-響應循環消除掉。這意味著客戶端代碼再也不需要直接處理 XMLHttpRequest
對象或者服務器的響應。不再需要編寫對象的序列化代碼或者使用第三方工具才能把對象變成 XML。甚至不再需要編寫 servlet 代碼把 Ajax 請求調整成對 Java 域對象的調用。
???
DWR 是作為 Web 應用程序中的 servlet 部署的。把它看作一個黑盒子,這個 servlet
有兩個主要作用:首先,對于公開的每個類,DWR 動態地生成包含在 Web 頁面中的 JavaScript。生成的 JavaScript
包含存根函數,代表 Java 類上的對應方法并在幕后執行 XMLHttpRequest
。
這些請求被發送給 DWR,這時它的第二個作用就是把請求翻譯成服務器端 Java 對象上的方法調用并把方法的返回值放在 servlet
響應中發送回客戶端,編碼成 JavaScript。DWR 還提供了幫助執行常見的用戶界面任務的 JavaScript 工具函數。
---------------------------------
概述
這篇文章闡述了使用開源項目DWR(直接Web遠程控制)和AJAX(異步JavaScript和XML)的概念來提高Web應用的可用性。作者一步步來展示DWR如何使得AJAX的應用既簡單又快捷。(1600字;2005年6月20日)
AJAX,
或者說是異步JavaScript和XML,描述了一種使用混合了HTML(或XHTML)和層疊樣式表作為表達信息,來創建交互式的Web應用的開發技
術;文檔對象模型(DOM),JavaScript,動態地顯示和與表達信息進行交互;并且,XMLHttpRequest對象與Web服務器異步地交換
和處理數據。
因特網上許多例子展示了在一個HTML文件內部使用XMLHttpRequest與服務器端進行交互的必要的步驟。當手工地
編寫和維護XMLHttpRequest代碼時,開發者必須處理許多潛在的問題,特別是類似于跨瀏覽器的DOM實現的兼容性這樣的問題。這將會導致在編碼
和調試Javascript代碼上面花費數不清的時間,這顯然對開發者來說很不友好。
DWR(直接Web遠程控制)項目是在Apache
許可下的一個開源的解決方案,它供給那些想要以一種簡單的方式使用AJAX和XMLHttpRequest的開發者。它具有一套Javascript功能
集,它們把從HTML頁面調用應用服務器上的Java對象的方法簡化了。它操控不同類型的參數,并同時保持了HTML代碼的可讀性。
DWR
不是對一個設計的插入,也不強迫對象使用任何種類的繼承結構。它和servlet框架內的應用配合的很好。對缺少DHTML編程經驗的開發者來說,DWR
也提供了一個JavaScript庫包含了經常使用的DHTML任務,如組裝表,用item填充select下拉框,改變HTML元素的內容,如<
div>和<span>
DWR網站是詳盡的并且有大量的文檔,這也是這篇文章的基礎。一些例子用來展示DWR如何使用和用它的庫可以完成什么樣的工作。
這篇文章讓讀者看到了一個使用了DWR的Web應用是如何一步步建立的。我會展示創建這個簡單的示例應用的必要的細節,這個應用是可下載的并且可以在你的環境中布署來看看DWR如何工作。
注意:找到有關AJAX的信息并不困難;網頁上有幾篇文章和博客的條目涵蓋了這個主題,每一個都試圖指出和評論這個概念的不同的方面。在資源部分,你會找到一些有趣的指向示例和文章的鏈接,來學習AJAX的更多的內容。
示例應用
這篇文章使用的示例應用模擬了多倫多的一個公寓出租搜索引擎。用戶可以在搜索前選擇一組搜索標準。為了提高交互性,AJAX中以下兩種情況下使用:
·應用通告用戶配合他的選擇會返回多少搜索結果。這個數字是實時更新的-使用AJAX-當用戶選擇的臥室和浴室的數量,或者價格范圍變化時。當符合標準的搜索結果沒有或太多時,用戶就沒有必要點擊搜索按紐。
·數據庫查詢并取回結果是由AJAX完成的。當用戶按下顯示結果按鈕時,數據庫執行搜索。這樣,應用看起來更具響應了,而整個頁面不需要重載來顯示結果。
數據庫
我們使用的數據庫是HSQL,它是一種占用資源很小的Java SQL數據庫引擎,可以不需要安裝和配置的與Web應用捆綁在一起。一個SQL文件被用來在Web應用的上下文啟動時創建一個內存中的表并添加一些記錄。
Java類
應
用包含了兩個主要的類叫Apartment和ApartmentDAO。Apartment.java類是一個有著屬性和getter/setter方法
的簡單的Java類。ApartmentDAO.java是數據訪問類,用來查詢數據庫并基于用戶的搜索標準來返回信息。ApartmentDAO類的實
現的直接了當的;它直接使用了Java數據庫聯接調用來得到公寓的總數和符合用戶請求的可用公寓的列表。
DWR配置和使用
設
置DWR的使用是簡單的:將DWR的jar文件拷入Web應用的WEB-INF/lib目錄中,在web.xml中增加一個servlet聲明,并創建
DWR的配置文件。DWR的分發中需要使用一個單獨的jar文件。你必須將DWR
servlet加到應用的WEB-INF/web.xml中布署描述段中去。
????<servlet>
????????<servlet-name>dwr-invoker</servlet-name>
????????<display-name>DWR Servlet</display-name>
????????<description>Direct Web Remoter Servlet</description>
????????<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
????????<init-param>
????????????<param-name>debug</param-name>
????????????<param-value>true</param-value>
????????</init-param>
????</servlet>
????<servlet-mapping>
????????<servlet-name>dwr-invoker</servlet-name>
????????<url-pattern>/dwr/*</url-pattern>
????</servlet-mapping>
一
個可選的步驟是設置DWR為調試模式—象上面的例子那樣—在servlet描述段中將debug參數設為true。當DWR在調試模式時,你可以從
HTMl網頁中看到所有的可訪問的Java對象。包含了可用對象列表的網頁會出現在/WEBAPP/dwr這個url上,它顯示了對象的公共方法。所列方
法可以從頁面中調用,允許你,第一次,運行服務器上的對象的方法。下圖顯示了調試頁的樣子:

調試頁
現
在你必須讓DWR知道通過XMLHttpRequest對象,什么對象將會接收請求。這個任務由叫做dwr.xml的配置文件來完成。在配置文件中,定義
了DWR允許你從網頁中調用的對象。從設計上講,DWR允許訪問所有公布類的公共方法,但在我們的例子中,我們只允許訪問幾個方法。下面是我們示例的配置
文件:
<dwr>
????<allow>
????????<convert converter="bean" match="dwr.sample.Apartment"/>
????????<create creator="new" javascript="ApartmentDAO" class="dwr.sample.ApartmentDAO">
????????????<include method="findApartments"/>
????????????<include method="countApartments"/>
????????</create>
????</allow>
</dwr>
上
面的文件實現了我們例子中的兩個目標。首先,<convert>標記告訴DWR將dwr.sample.Apartment對象的類型轉換為
聯合數組,因為,出于安全的原因,DWR默認的不會轉換普通bean。第二,<create>標記讓DWR暴露出
dwr.sample.ApartmentDAO類給JavaScript調用;我們在頁面中使用JavaScript文件被javascript屬性定
義。我們必須注意<include>標記,它指明了dwr.sample.ApartmentDAO類的哪些方法可用。
HTML/JSP代碼
配
置完成后,你就可以啟動你的Web應用了,這時DWR會為從你的HTML或Java服務器端頁面(JSP)上調用所需方法作好準備,并不需要你創建
JavaScript文件。在search.jsp文件中,
我們必須增加由DWR提供的JavaScript接口,還有DWR引擎,加入以下三行到我們的代碼中:
??<script src='dwr/interface/ApartmentDAO.js'></script>
??<script src='dwr/engine.js'></script>
??<script src='dwr/util.js'></script>
我
們注意到當用戶改變搜索標準時,這是AJAX在示例程序中的首次應用;正如他所看到的,當標準改變時,可用的公寓數量被更新了。我創建了兩個
JavaScript函數:當某一個選擇下拉框中的值變化時被調用。ApartmentDAO.countApartments()函數是最重要的部分。
最有趣的是第一個參數,
loadTotal()函數,它指明了當接收到服務端的返回時DWR將會調用的JavaScript方法。loadTotal于是被調用來在HTML頁面
的<div>中顯示結果。下面是在這個交互場景中所使用到的JavaScript函數:
function updateTotal() {
????$("resultTable").style.display = 'none';
????var bedrooms = document.getElementById("bedrooms").value;
????var bathrooms = document.getElementById("bathrooms").value;
????var price = document.getElementById("price").value;
????ApartmentDAO.countApartments(loadTotal, bedrooms, bathrooms, price);
}
function loadTotal(data) {
????document.getElementById("totalRecords").innerHTML = data;
}
很明顯,用戶想看到符合他的搜索條件的公寓列表。那么,當用戶對他的搜索標準感到滿意,并且總數也是有效的話,他會按下顯示結果的按紐,這將會調用updateResults() JavaScript方法:
function updateResults() {
????
????DWRUtil.removeAllRows("apartmentsbody");
????var bedrooms = document.getElementById("bedrooms").value;
????var bathrooms = document.getElementById("bathrooms").value;
????var price = document.getElementById("price").value;
????ApartmentDAO.findApartments(fillTable, bedrooms, bathrooms, price);
????$("resultTable").style.display = '';
}
function fillTable(apartment) {
????DWRUtil.addRows("apartmentsbody", apartment, [ getId, getAddress, getBedrooms, getBathrooms, getPrice ]);
}
updateResults
()方法清空了存放搜索返回結果的表域,從用戶界面上獲取所需參數,并且將這些參數傳給DWR創建的ApartmentDAO對象。然后數據庫查詢將被執
行,fillTable()將會被調用,它解析了DWR返回的對象(apartment),然后將其顯示到頁面中(apartmentsbody)。
安全因素為
了保持示例的簡要,ApartmentDAO類盡可能的保持簡單,但這樣的一個類通常有一組設置方法來操作數據,如insert(),
update()和delete()。DWR暴露了所有公共方法給所有的HTML頁面調用。出于安全的原因,像這樣暴露你的數據訪問層是不明智的。開發者
可以創建一個門面來集中所有JavaScript函數與底層業務組件之間的通信,這樣就限制了過多暴露的功能。
結論這
篇文章僅僅讓你在你的項目中使用由DWR支持的AJAX開了個頭。DWR讓你集中注意力在如何提高你的應用的交互模型上面,消除了編寫和調試
JavaScript代碼的負擔。使用AJAX最有趣的挑戰是定義在哪里和如何提高可用性。DWR負責了操作Web頁面與你的Java對象之間的通信,這
樣就幫助你完全集中注意力在如何讓你的應用的用戶界面更加友好,
我想感謝Mircea Oancea和Marcos Pereira,他們閱讀了這篇文章并給予了非常有價值的返匱。
資源·javaworld.com:
javaworld.com·Matrix-Java開發者社區:
http://www.matrix.org.cn/·onjava.com:
onjava.com·下載示例程序的全部源碼:
http://www.javaworld.com/javaworld/jw-06-2005/dwr/jw-0620-dwr.war·DWR: http://www.getahead.ltd.uk/dwr/index.html
·HSQL:http://hsqldb.sourceforge.net/
·AJAX的定義:http://en.wikipedia.org/wiki/AJAX
·
“AJAX:通向Web應用的新途徑": Jesse James Garrett (Adaptive Path, 2005.2):
http://www.adaptivepath.com/publications/essays/archives/000385.php
· “非常動態的Web界面” Drew McLellan (xml.com, 2005.2): http://www.xml.com/pub/a/2005/02/09/xml-http-request.html
·XMLHttpRequest & AJAX 工作范例: http://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples
· “可用的XMLHttpRequest實踐” Thomas Baekdal (Baekdal.com, 2005.3): http://www.baekdal.com/articles/Usability/usable-XMLHttpRequest/
·"XMLHttpRequest
使用導引" Thomas Baekdal
(Baekdal.com,??2005.2):http://www.baekdal.com/articles/Usability/XMLHttpRequest-guidelines/
·AJAX實質:http://www.ajaxmatters.com/
posted @
2006-08-16 17:06 阿成 閱讀(291) |
評論 (0) |
編輯 收藏