tailieunhanh - Core JAVASERVER™ FACES

When we heard about JavaServer Faces (JSF) at the 2002 JavaOne conference, we were very excited. Both of us had extensive experience with client-side Java programming—David in Graphic Java™, and Cay in Core Java™, both published by Sun Microsystems Press—and we found web programming with servlets and JavaServer Pages (JSP) to be rather unintuitive and tedious. JSF promised to put a friendly face in front of a web application, allowing programmers to think about text fields and menus instead of dealing with page flips and request parameters. Each of us proposed a book project to our publisher, who promptly suggested that we should jointly write the Sun Microsystems. | DAVID GEARY CAY HORSTMANN FACELETS PAGE LAYOUT Hl xml version encoding UTF-8 DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD html xmlns http 1999 xhtml xmlns f http jsf core xmlns h http jsf html xmlns ui http jsf facelets h head . h head h body h form . h form h body html TEXT FIELD Ị12345678901234567890 h inputText value WEB-INF classes com corejsf @Named bean1 or @ManagedBean name bean1 Hl @SessionScoped public class SampleBean public int getLuckyNumber . public void setLuckyNumber int value . . BUTTON press me I h commandButton value press me action WEB-INF classes com corejsf public class SampleBean public String login if . return success else return error . The outcomes success and error can be mapped to pages in . If no mapping is specified the page or is displayed. 1 1 GET REQUESTS Hl f metadata f viewParam name item value f viewParam name userId value f metadata Request parameters set bean properties before the page is rendered. h button value Continue outcome includeViewParams true The getContinueOutcome method is called when Hie button is rendered. The view parameters are added to the request URL. RADIO BUTTONS Cheese f7 Pickle Mustard Lettuce Onions h selectOneRadio value f selectItems value var it Hl itemLabel itemValue h selectOneRadio WEB-INF classes com corejsf public class SampleBean public Collection Condiment getChoices . public int getCondiment . public void setCondiment int value . . WEB-INF classes com corejsf public class Condiment public String getDescription . public int getProductId . CONVERSION h outputText value f convertNumber type .

crossorigin="anonymous">
Đã 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.