JSF 1.2 book

Hi,
is there any good book about JSF which covers also JSF 1.2?
Or are the differences between 1.1 and 1.2 so important that I should buy 1.2-compliant book?
Thank you

Try this book: http://www.amazon.com/JavaServer-Faces-Complete-Reference-Burns/dp/product-description/0072262400
It covers 1.2 and AJAX. One of the authors is the current JSF co-spec lead.

Similar Messages

  • Authentication in JSF 2.0

    I could use some advise... I've been trying to implement authentication in a JSF 2.0 web application and I've not been completely successful. I'm using NetBeans 6.8 and GlassFish v3. Here is what I would like:
    1) Use container managed security with a JDBC realm. Users who register via the web app will end up as users in the table that is used to authenticate access to the web app
    2) I want to use role-base authorization that I can specify in my web.xml file as [described in the JEE 6 tutorial.|http://java.sun.com/javaee/6/docs/tutorial/doc/bnbxj.html#bnbxu]. Thus, I'd like to secure JSF pages as well as managed bean actions.
    3) My web app uses EJB's that are secured using the [EJB annotations as described in the JEE 6 tutorial|http://java.sun.com/javaee/6/docs/tutorial/doc/bnbyl.html#gjgcq]. My understanding is that the credentials from the web app are propagated to the EJB's, so I should not need to do anything, other than catch exceptions whenever the EJB is being accessed by an unauthorized role.
    4) Ideally, I'd like to use a JSF form to request username/password from a user. I know the JSF form cannot directly post the information to the container's security mechanism (i.e. j_security_check action). While I've found some ways to do it, none are really satisfactory, so I've had to just use a plain HTML form.
    5) I could do it [authentication programmatically as explained in the JEE 6 tutorial|http://java.sun.com/javaee/6/docs/tutorial/doc/gjiie.html]. Unfortunately, the tutorial shows how to do this from a Servlet and not from JSF. In particular, I could invoke the HttpServletRequest#login method, but its result does not enter a session and thus I cannot continue to use container managed authorization past the request. If I use HttpServletRequest#authenticate, then this will force the container to present the login form I specify in web.xml and the credentials will be in the session.
    6) FYI, I've tried to implement an authentication a Filter but the URL requests that come from a JSF 2.0 app just do not correspond to what I'm looking for in the filter. That is, if I have a directory named secured where I keep JSF pages to be accessed only by authenticated users, I set up a Filter to look for these requests and it does not behave as expected (or at least the way it behaves when I use it with JSP)
    I hope someone here can help me find the resources so I can implement this. I've Googled many times and most of what I'm finding is incomplete. I'd greatly appreciate anyone's help and guidance in this. FYI... some students are counting on me to deliver a solution to this! I did not think it would be difficult, but it has turned out to be that way.
    Thanks for reading this far!
    Alvaro

    Hello Ed. I have your JSF 2.0 book now. I download and tried the authentication example that you have on chapter 14. Unfortunately, authorization is not working as I would expect it. Here are the specifics:
    1) I'm running it on GlassFish v3
    2) According to the web.xml, you create two security constraints. One on /trainer/*** requests to be accessed only by users with role of trainer. Another on the /user/*** requests to be accessed only by users with role of user
    3) Whenever I try this app, I can access that pages without ever being authenticated (i.e. without logging in). I can access them by entering the URL's, say: http://localhost:8080/formBasedLogin/faces/user/userPage.xhtml
    This is the problem I've been having whenever I try to do authorization. For some reason, either the URL is not matching the pattern specified or it gets rewritten by JSF 2.0 in some way?
    Update: I'll leave the above comments, but I was able to get your example working by changing the URL patterns to: /faces/user/*** and /faces/trainer/*** Is this an error in the sample code or should the pattern you provide still work?
    Update 2: It seems that I've now figured out that there is a difference on whether I use an outputLink or a commandLink. I need to read more about this. In any case, the URL patterns do match requests that are specified as an outputLink, but not when they are specified by a commandLink -- in this case, JSF uses JavaScript to make the request to some resource which does not match the pattern. It looks like I was just using commandLink before whereas I should have been using outputLink.

  • JSF 2 : offline api references and recommended online ones ?

    Hello,
    I want to find an offline good reference on the jsf components.
    I'm currently learning about jsf 2.0 from core jsf 2.0 book + glassfish + cdi.
    I've found the online version such as
    http://download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/index.html
    and
    http://www.jsftoolbox.com/documentation/help/12-TagReference/index.jsf
    , but so far i've been unlucky to find the offline versions of the api doc.
    Could anyone share offline versions of it, and maybe share other good jsf 2.0 references ?
    Thank you !

    There is a design forum.
    I think you have a few too many keywords in there. Hopefully someone with experience end to end might clear that up.
    You'd end up with a single class that has both hibernate and JSF annotations on it.Even if possible I suspect that no one is going to recommend that.

  • JSF 2 : dynamic required validation for different buttons ?

    Hello,
    I'm currently learning about jsf 2.0 from core jsf 2.0 book + glassfish + cdi.
    I have a question about the validation feature of JSF.
    Let's say i have a very simple login application, which has a very simple layout like :
    userid : (input field for userid - using required="true")
    password : (input secret for password - using required="true")
    loginButton + registerButton(using immediate="true") + checkUserIdAvailabilityButton
    Now, let's say the loginButton is pressed, and the userid and password are left empty, validation error would occur on both of the fields, and that's working as what i intended.
    And when the registerButton is pressed, it doesnt care whether the userid or password is filled by the user, since it's using immediate="true", thus bypassing validation and the command gets executed at the apply request value phase, and that's still working as what i intended.
    And here comes my problem .. When the checkUserIdAvailabilityButton is pressed, i only expect the userid to be filled, and i dont need to care about whether the password field is filled or not, but the password field will throw error saying that it's a required field.
    Is there anyway to resolve this kind of problem ? I know this could be a very simple application, but in my working place, i think they design lots of screens like this, like the save button along with refresh button with different required fields but the buttons are in the same page.
    Thank you !

    Hello there !
    Thank you for the response.
    I agree with the server side approach. I also find it not easy to maintain lots of uncentralized validations on many jsf pages.
    For example, validation on the my CustomerName's length could get replicated on hundreds of pages, and when the requirement changes, i have to update many pages.
    But doing this on the serverside is not easy either, i suppose, got to have a custom framework to fill the needs. Im thinking of a general validator that could validate when supplied the variable's name, and the validator will know whether the field needs validating on the correctness of the date value, or the length of the fieldname, etc, based on some external configuration that says this variable is a type of date, with max length of this, min value of that, etc.
    If i dont have this kind of tools, i'll also replicate all the validations like the CustomerName's case on many bean methods, which i think is not maintainable too.
    Do you happen to know whether this kind of validation tools exist somewhere ? I dont think that bean validation framework from jsr 303 would fill my need, am i correct ?
    Regards,
    Albert Kam

  • Symbol script to change image

    Would it be possbile to have have a symbol script that allows me to select which image out of 5 or 6 should be viewable, and have it in just one field as compared to toggling the visibility of 6 seperate image fields

    Managed to figure out how to do this by adding a few functions to the symbols .jsf file. If anyone happens to have the same problem a working version of my symbol and the corresponding .jsf code can be found below.
    Sample
    http://i.imgur.com/Jy8RZ.png
    .jsf file
    4
    Book%20Title,textChars,Book%20Title,Title;
    Book%20Publisher,textChars,Book%20Publisher,Publisher;
    Highlight%20Box,visible,Is%20Selected,false;
    Visible%20Image,fontsize,Selected%20Image,0;
    function shouldIBeVisible(myNumber)
    var values = Widget.elem.customData["currentValues"];
    if (values[3].value == myNumber )
    return true;
    return false;
    function isSelected(status)
    if (status)
    return "#ff0066";
    return "#dac4a5";
    function setDefaultValues()
    var values = new Array();
    values.push({ name:"Book Title", type:"text", value:"Title" });
    values.push({ name:"Book Publisher", type:"text", value:"Publisher" });
    values.push({ name:"Is Selected", type:"boolean", value:"false" });
    values.push({ name:"Selected Image", type:"number", value:"0" });
    Widget.elem.customData["currentValues"] = values;
    function applyCurrentValues()
    var values = Widget.elem.customData["currentValues"];
    Widget.GetObjectByName("Book Title").textChars = values[0].value;
    Widget.GetObjectByName("Book Publisher").textChars = values[1].value;
    Widget.GetObjectByName("Highlight Box").pathAttributes.brushColor = isSelected(values[2].value);
    Widget.GetObjectByName("Image1").visible = shouldIBeVisible(1);
    Widget.GetObjectByName("Image2").visible = shouldIBeVisible(2);
    Widget.GetObjectByName("Image3").visible = shouldIBeVisible(3);
    Widget.GetObjectByName("Image4").visible = shouldIBeVisible(4);
    Widget.GetObjectByName("Visible Image").fontsize = values[3].value;
    switch (Widget.opCode)
    case 1: setDefaultValues();   break;
    case 2: applyCurrentValues(); break;

  • Looking for "Java Web Developers Toolkit"

    Hi,
    Where can I find the Java classes that comprise the "Java Web Developers Toolkit"?
    I'd perferr not to install a full size tool like JDevelope. I really just need the classes.
    Art

    To start, ensure that you get books/tutorials which covers JSF 1.2. Some old books still covers JSF 1.1 only and the changes in 1.2 were fairly big. I can recommend the book "JSF: The Complete Reference". If I am correct, the "JSF in Action" book is only targeted on JSF 1.1 and thus fully outdated.
    To learn JSF you need to learn/know/understand at least the following basic concepts:
    HTTP: [http://www.w3.org/Protocols/rfc2616/rfc2616.html]
    HTML: [http://www.w3schools.com/html/]
    CSS: [http://www.w3schools.com/css/]
    JS: [http://www.w3schools.com/JS/]
    HTML DOM: [http://www.w3schools.com/HTMLDOM/]
    JSP/Servlet: [http://java.sun.com/javaee/5/docs/tutorial/doc/] (part II chapters 1-9)
    Once learnt/understood the above stuff, you can continue with JSF:
    JSF specification: [http://jcp.org/aboutJava/communityprocess/final/jsr252/index.html] (pick 1st download)
    JSF API document: [http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/overview-summary.html]
    JSF TLD document: [http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/tlddocs/index.html]
    JSF in general: [http://java.sun.com/javaee/5/docs/tutorial/doc/] (part II chapters 10-15)
    As an alternative to JSP you can also use Facelets, which offers much more advantages above JSP, especially in terms of templating and compositions. The upcoming JSF 2.0 is going to use Facelets as the default supported view technology instead of JSP. So it is better to learn it as well: [https://facelets.dev.java.net/nonav/docs/dev/docbook.html].

  • Dynamic h:dataTable with embedded h:selectBooleanCheckbox(es) & view state

    Hi
    I hope someone can help me. I'm trying to create a form somewhat like the one in allEvents.xhtml of the Virtual Trainer app in Ed Burns' JSF 2.0 book. My form is similar in that it uses an h:dataTable to display a set of rows that include an h:selectBooleanCheckbox. (In my case, the row also contains an h:inputText). So far, that's all working fine.
    However, to complicate things, I've added an <h:selectOneMenu immediate="true" onchange="this.form.submit()"/> to change the contents of the datatable based on the menu selection. This is where things start to go wrong. When the menu selection changes, the dataTable does update to show the new set of rows. However, there seems to be some state in the dataTable or the view that does not get reset when the content changes.
    This causes a couple of problems: When the initial menu selection is 'noSelectionOption' and the dataTable value is 'an empty list', then the menu selection changes, none of the input items' values are set when the form is submitted. It seems like dataTable remembered that the list is empty, and subsituting a longer list is confusing it. Or, is it the view that's confused because the number of input elements changed?
    When I initialize the menu selection to one that has a non-empty dataTable list associated with it, things work as desired, but changing menu selections again confuse things (checkboxes remain checked, rows beyond those in the initial list don't get their values set.) Hopefully, you're still with me.
    It seems like this should be do-able. What am I missing? I've boiled it down to a simple example. I appreciate your help. The code:
    selectitems.xhtml
    <html xmlns="http://www.w3.org/1999/xhtml"
    >
        <ui:fragment rendered="#{!empty facesContext.messageList}">
          <h:messages layout="list" />
        </ui:fragment>
        <h:form>
    <div>
          <h:outputLabel for="categories">Category</h:outputLabel>
          <h:selectOneMenu id="categories" tabindex="3" value="#{optionsBean.category}" immediate="true" onchange="this.form.submit()" required="true">
            <f:selectItem itemValue="#{optionsBean.categoryNotSelected}" itemLabel="-- select one --" noSelectionOption="true" />
            <f:selectItems value="#{optionsBean.categories}" />
          </h:selectOneMenu>
    <div>
    </div>
          <h:outputLabel for="optionlist">Options</h:outputLabel>
          <h:dataTable immediate="true" id="optionlist" value="#{optionsBean.optionData}" var="data" binding="#{optionsBean.optionTable}">
            <h:column>
              <h:selectBooleanCheckbox id="ctselect" value="#{optionsBean.optionSelected}" />
              <h:outputLabel for="ctselect" value="#{data.label}" />
              <ui:fragment rendered="#{!empty data.detailLabel}">
                <h:inputText id="ctdetail" value="#{optionsBean.optionDetail}" />
                <h:outputLabel for="ctdetail" value="#{data.detailLabel}" />
              </ui:fragment>
            </h:column>
          </h:dataTable>
    </div>
        <h:commandButton action="#{optionsBean.submit}" type="submit" value="Submit"/>
         <h:button outcome="/index" value="Cancel" />
        </h:form>
    </html>OptionsBean.java
    package org.example;
    @ManagedBean
    public class OptionsBean
      int category = getCategoryNotSelected();
      private UIData optionTable;
      private DataModel<OptionTableRow> optionData = new ListDataModel<OptionTableRow>();
      private List<OptionTableRow> optionList = new ArrayList<OptionTableRow>();
      // static data for demonstration use
      private static List<SelectItem> categories = new ArrayList<SelectItem>();
      private static List<OptionTableRow> sizeOptionList = new ArrayList<OptionTableRow>();
      private static List<OptionTableRow> colorOptionList = new ArrayList<OptionTableRow>();
      private static List<OptionTableRow> styleOptionList = new ArrayList<OptionTableRow>();
      static
        OptionsBean o = new OptionsBean();
        sizeOptionList.add( o.new OptionTableRow( "small" ) );
        sizeOptionList.add( o.new OptionTableRow( "medium" ) );
        sizeOptionList.add( o.new OptionTableRow( "large" ) );
        sizeOptionList.add( o.new OptionTableRow( "other", "specify" ) );
        colorOptionList.add( o.new OptionTableRow( "red" ) );
        colorOptionList.add( o.new OptionTableRow( "green" ) );
        colorOptionList.add( o.new OptionTableRow( "blue" ) );
        colorOptionList.add( o.new OptionTableRow( "other", "specify" ) );
        styleOptionList.add( o.new OptionTableRow( "modern" ) );
        styleOptionList.add( o.new OptionTableRow( "traditional" ) );
        categories.add( new SelectItem( 1, "size" ) );
        categories.add( new SelectItem( 2, "color" ) );
        categories.add( new SelectItem( 3, "style" ) );
      public OptionsBean()
    //    setCategory( getCategoryNotSelected() );
        setCategory( 3 );
      public int getCategoryNotSelected()
        return -1;
      public boolean isOptionSelected()
        OptionTableRow row = (OptionTableRow) optionTable.getRowData();
        return row.selected;
      public void setOptionSelected( boolean selected )
        OptionTableRow row = (OptionTableRow) optionTable.getRowData();
        row.selected = selected;
      public String getOptionDetail()
        OptionTableRow row = (OptionTableRow) optionTable.getRowData();
        return row.detail;
      public void setOptionDetail( String detail )
        OptionTableRow row = (OptionTableRow) optionTable.getRowData();
        row.detail = detail;
      public String submit()
        int count = 0;
        for ( OptionTableRow opt : optionList )
          if ( opt.selected )
            count++;
        if ( count == 0 )
          FacesContext fc = FacesContext.getCurrentInstance();
          fc.addMessage( null, new FacesMessage( FacesMessage.SEVERITY_ERROR, "At least one option must be selected", null ) );
          return null;
        return "showoptions";
      public DataModel<OptionTableRow> getOptionData()
        optionData = new ListDataModel<OptionTableRow>( optionList );
        optionData.setRowIndex( -1 );
        return optionData;
      public void setCategory( int category )
        this.category = category;
        switch ( category )
          case 1:
            optionList = sizeOptionList;
            break;
          case 2:
            optionList = colorOptionList;
            break;
          case 3:
            optionList = styleOptionList;
            break;
      public class OptionTableRow
        private String label;
        private boolean selected = false;
        private String detailLabel = null;
        private String detail = null;
        public OptionTableRow() { }
        public OptionTableRow( String label )
          this.label = label;
        public OptionTableRow( String label, String detailLabel )
          this.label = label;
          this.detailLabel = detailLabel;
    // getters and setters omitted for brevity
      }

    flyeminent wrote:
    However in my particular case, the dynamic list is not known until the user choose to view a table. Then move the call from the getter to the bean's action method.

  • How to use SelectOneRadio within a DataTable

    Hi,
    I have a requirement to have a radio button for each row in the datatable. It is to enable selecting one row(only one row) from the table and proceed to the next page. The table should look like
    o Name1 address1 city1 state1
    o Name2 address2 city2 state2
    o Name3 address3 city3 state3
    o Name4 address4 city4 state4
    Next>>
    The data structure I have is a collection on objects of type person.
    Class person
    String id;
    String name;
    String address;
    String city;
    String state;
    getters and setters
    I tried to use SelectOneRadio within a Column, but that didnt help. As obvious it treats each rows radio button as a seperate radio group.
    <h:datatable var="person" value="#{personList}>
    <h:column>
    <h:selectOneRadio>
    <f:selectItem itemValue="#{person.id}"/>
    </h:selectOneRadio>
    </h:column>
    <h:column>
    <h:outputText value="#{person.name}"\>
    </h:column>
    </h:datatable>
    I am new to JSF. I searched thru some JSF websites and book, but couldnt find a solution. Can someone help me solve this.
    Thanks in advance
    Rani

    Hi,
    after some time probing into this issue I think none of the many proposed sollutions really solves the underlying problem: Working around the issue becomes much to complicated for JSFs stated design goal of easing development. Certainly for such a common case scenario no workaround should be neccessary, especially given the fact that JSTL is easily able to model this without the need for workarounds!
    In my opinion JSF TagLib implementations should attempt to solve this in a coming version.
    One part of the sollution might be to make <f:selectItem> search it's parent element recursively, i.e. allow the expected container element to be the nearest direct or indirect parent that's suitable. This would allow developers to envelope a <h:dataTable> tag with a <h:selectOneRadio> element. Any <f:selectItem> element inside would therefore be part of a single choice radio button selection, regardless of them being distributed over multiple rows or columns.
    Another part of the sollution might be to allow <h:selectOneRadio> and similar tags to be substitutes for <h:column> tags inside tables. This way a complete column of radio buttons could be used to chose a single value, thereby allowing multiple columns of radio buttons to choose multiple values within the same table.
    Please forward this suggestion for enhancement in kind to the expert group working on the further development of the JSF taglibs. I guess many people besides me already use it as a classical example of complications using JSF during lectures about the tomic, and at least in this case the problem seems completely solvable.
    Kind regards,
    Sascha Baumeister
    software architect, university lecturer and former JCP spec lead JSR086

  • Online Booking System - Tutorials (Java, ADF, JSF)

    Hi!
    I am working on an Online Flight Booking System. The preferred technology is Java, ADF, JSF etc. I am familiar
    with JDeveloper, however I would like to know if tutorials/videos on similar systems are available. Many commercial
    airlines have professional booking systems that use a train stop control to show the current process step.
    Also interesting to know would be how the template pages are created that populate the data dynamically from the
    db. etc.
    Any information on this subject would be greatly appreciated.

    There are plenty of material available, may be not exactly what you are looking for but a start:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/adfinsideressentials-337133.html
    blogs.oracle.com/smuenchadf/resource/examples
    http://blogs.oracle.com/shay/
    Timo

  • JSF 1.2 Recommended books

    Hi there,
    i wonder if anybody can help?
    I am trying to get some recommendations on books available for JSF .. 1.2 if possible...
    I am coming from a asp.net background so the JSF (MVC) stuff is pretty confusing to me .. i think i need a standard book to go through what everything means..
    If anybody can suggest anything i would really appreciate it
    Thanks
    Ian

    check JSF in action by kito d mann.... it is a gr8 book...

  • JSF Books or Tutorial

    Which book of JSF is good for beginning?
    Any Basic or Beginning Tutorial???

    Another good tutorial in 4 parts:
    http://www-128.ibm.com/developerworks/java/library/j-jsf1/
    http://www-128.ibm.com/developerworks/java/library/j-jsf2/
    http://www-128.ibm.com/developerworks/java/library/j-jsf3/
    http://www-128.ibm.com/developerworks/java/library/j-jsf4/
    Greets

  • JSF Books or WebSites

    Hi,
    As i am new to JSF..Can anyone suggest me some books for JSF or any websites to learn JSF
    Thanks.

    I bought:
    The Complete Reference JavaServer Faces (Schalk/Burns), 2007and
    JavaServer Faces in Action (Mann), 2005Personally, I'm not 100% convinced by either of them - certainly not from a beginners perspective.
    James.

  • JSF reference book

    Any JSF good book to recommend? I'm creating java system using JSF dynamically. Thanks.

    Actually,
    there is quite a list, but the three names that show up frequently are "JavaServer Faces in Action" by Kito Mann, "Java ServerFaces" by Hans Bergsten and "Core JavaServer Faces" by SUN. However, I didn't read them all and thus don't want to judge them (especially because there are more books out, like "Mastering JavaServer Faces" and "JavaServer Faces programming".
    Personally I own "JavaServer Faces in Action" and I am quite happy with it. However, here's my recommendation for you
    1. go to www.jcp.org and download teh Specifrication for JSR-127. Its well written and pretty detailed. You find a lot of information much quicker in here.
    2. Do a search for JSF on amazon, barnes&nobles or whatever you preferred book seller is. Pick 1 - 3 items and search google for review statement or sample chapters. Thsi at least is teh way I do enjoy book-shopping.
    Frank

  • BOOK ON JSF and AJAX

    Small Question:
    What is best book available on Ajax and JSF for Java. I am good in j2ee and struts. Working java for last 10 years.
    Please help me.

    [ What is best book available on Ajax and JSF for Java. I am good in j2ee and struts. Working java for last 10 years.
    /i]
    sounds good...
    I have small query you will help me. I am new to j2ee technology.I am working on a product which allow us to create the form dynamically based on information provided through CMA by Admin and Admin can also associate any validation rule for each created form at any time.. so for this requirment for front end which Java and JavaScript FramWork will be best.... please help me..
    Thanks in advance

  • Good books to learn JSF

    Hi,
    can anyone tell good books(with examples) to learn JSF.
    thanks in advance.

    -> http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=82&t=000820

Maybe you are looking for

  • [Solved] Amarok stops playback after switching audio streams

    Well, I'm posting this here so if anyone else has this bug, and search the forums, they will find the answer, since I didn't find the answer in the wiki (atleast not the one for archlinux). This is on a new install of Archlinux, running kde4.3 but on

  • ITunes stuttering when running a program.

    Hi there, After upgrading to a new iMac with Lion, running into issues with iTunes that wasn't present before.  My older 21" iMac (4 GB RAM) ran Maxwell Render ( 3D modeling software) and iTunes with no performance issues.  My new beefed up 27" iMac

  • Iphoto 9.4.3 crashing

    iphoto was working fine last night. I havent done any updated and this morning it just keeps crashing ! Please advise

  • Lot of erros in

    I have downloadet Flash_ActionScript3.0_samples.zip And used theone caled "Galleries" but can make it work in my one flash evry time i export it to swf it showes this: The class or interface 'URLLoader' could not be loaded. The class or interface 'Ev

  • Logging.xml

    how could i specify the Custom formatter and handler at logging.xml? While controlling programmatically, the logger works great and I am getting the perfect log as expected. How can I do that at design time? I tried in one of the way, here even the f