JSF Components (Woodstock, Richfaces) Vs. Ajax Component (YUI, JMaki)

Hello. I am pretty new in the Web 2.0 development. I started learning JSF 1.2 and I like it. I also found interesting by using Sun�s Woodstock, JBoss�s Richfaces and Oracle�s ADF components.
There are also so many Ajax libraries out there like JMaki, YUI (Yahoo), DWR. Now my question would be, is there any advantages using pure Ajax component like YUI to create GUI then using Richfaces or ADF? Please keep this in mind that I still want to use JSF architecture for the backend.
Thanks much
Hobi
Oklahoma, USA

http://hobione.wordpress.com/2008/02/22/jsf-drag-n-drop-with-jdeveloper-11g/

Similar Messages

  • Table display in Visual Web JSF (Project woodstock)

    Hi...
    I am trying to display a table(Quota) from a database in Visual Web JSF(project woodstock) and it works fine, as in I am able to run the project and a browser opens up dislaying the page with the date from the table. However when I try to display another table (Booking) from the same database, I am having problems. The page renders with no content(BLANK) in the browser. I am not sure why this is happening as I am using the same technique used to display content from the Quota table.
    This is my jsp code to display the Quota table ( this is the table that loads fine)
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page id="page1">
                <webuijsf:html id="html1">
                    <webuijsf:head id="head1">
                        <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body id="body1" style="-rave-layout: grid">
                        <webuijsf:form id="form1">
                            <h:panelGrid id="gridPanel1" style="left: 216px; top: 216px; position: absolute">
                                <webuijsf:staticText id="staticText1" style="font-size: large" text="FACILITY"/>
                                <webuijsf:table augmentTitle="false" id="table1" title="Table" width="0">
                                    <webuijsf:tableRowGroup id="tableRowGroup1" rows="5" sourceData="#{SessionBean1.quotaArray}" sourceVar="currentRow">
                                        <webuijsf:tableColumn headerText="allocatedhours" id="tableColumn1" sort="allocatedhours">
                                            <webuijsf:staticText id="staticText2" text="#{currentRow.value['allocatedhours']}"/>
                                        </webuijsf:tableColumn>
                                        <webuijsf:tableColumn headerText="yearofStudy" id="tableColumn2" sort="yearofStudy">
                                            <webuijsf:staticText id="staticText3" text="#{currentRow.value['yearofStudy']}"/>
                                        </webuijsf:tableColumn>
                                    </webuijsf:tableRowGroup>
                                </webuijsf:table>
                            </h:panelGrid>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>Below is the jsp code to view the Booking table ( I am just getting a blank web page when I run the project with this code).
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page id="page1">
                <webuijsf:html id="html1">
                    <webuijsf:head id="head1">
                        <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body id="body1" style="-rave-layout: grid">
                        <webuijsf:form id="form1">
                            <h:panelGrid id="gridPanel1" style="left: 216px; top: 216px; position: absolute">
                                <webuijsf:staticText id="staticText1" style="font-size: large" text="FACILITY"/>
                                <webuijsf:table augmentTitle="false" id="table1" title="Table" width="0">
                                    <webuijsf:tableRowGroup id="tableRowGroup1" rows="5" sourceData="#{SessionBean1.bookingArray}" sourceVar="currentRow">
                                        <webuijsf:tableColumn headerText="bookingdate" id="tableColumn1" sort="bookingdate">
                                            <webuijsf:staticText id="staticText2" text="#{currentRow.value['bookingdate']}"/>
                                        </webuijsf:tableColumn>
                                        <webuijsf:tableColumn headerText="bookingendtime" id="tableColumn2" sort="bookingendtime">
                                            <webuijsf:staticText id="staticText3" text="#{currentRow.value['bookingendtime']}"/>
                                        </webuijsf:tableColumn>
                                    </webuijsf:tableRowGroup>
                                </webuijsf:table>
                            </h:panelGrid>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>

    Hi..guys..
    The following is the code from my 'SessionBean1'.java file.
    package com.TestApp.managedbean;
    import com.TestApp.dao.QuotaFacadeLocal;
    import com.TestApp.entity.Quota;
    import com.TestApp.dao.BookingFacadeLocal;
    import com.TestApp.entity.Booking;
    import java.util.List;
    import javax.ejb.EJB;
    import com.sun.rave.web.ui.appbase.AbstractSessionBean;
    import javax.faces.FacesException;
    * <p>Session scope data bean for your application.  Create properties
    *  here to represent cached data that should be made available across
    *  multiple HTTP requests for an individual user.</p>
    * <p>An instance of this class will be created for you automatically,
    * the first time your application evaluates a value binding expression
    * or method binding expression that references a managed bean using
    * this class.</p>
    public class SessionBean1 extends AbstractSessionBean {
        // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
         * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
         * This method is automatically generated, so any user-specified code inserted
         * here is subject to being replaced.</p>
        private void _init() throws Exception {
        // </editor-fold>
         * <p>Construct a new session data bean instance.</p>
        public SessionBean1() {
        @EJB
         private BookingFacadeLocal bookingDAO;
         private Booking[] bookingArray;
         @EJB
         private QuotaFacadeLocal quotaDAO;
         private Quota[] quotaArray;    
         * <p>This method is called when this bean is initially added to
         * session scope.  Typically, this occurs as a result of evaluating
         * a value binding or method binding expression, which utilizes the
         * managed bean facility to instantiate this bean and store it into
         * session scope.</p>
         * <p>You may customize this method to initialize and cache data values
         * or resources that are required for the lifetime of a particular
         * user session.</p>
        @Override
        public void init() {
            // Perform initializations inherited from our superclass
            super.init();
            // Perform application initialization that must complete
            // *before* managed components are initialized
            // TODO - add your own initialiation code here
            // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
            // Initialize automatically managed components
            // *Note* - this logic should NOT be modified
            try {
                _init();
            } catch (Exception e) {
                log("SessionBean1 Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
            // </editor-fold>
            // Perform application initialization that must complete
            // *after* managed components are initialized
            // TODO - add your own initialization code here
         * <p>This method is called when the session containing it is about to be
         * passivated.  Typically, this occurs in a distributed servlet container
         * when the session is about to be transferred to a different
         * container instance, after which the <code>activate()</code> method
         * will be called to indicate that the transfer is complete.</p>
         * <p>You may customize this method to release references to session data
         * or resources that can not be serialized with the session itself.</p>
        @Override
        public void passivate() {
         * <p>This method is called when the session containing it was
         * reactivated.</p>
         * <p>You may customize this method to reacquire references to session
         * data or resources that could not be serialized with the
         * session itself.</p>
        @Override
        public void activate() {
         * <p>This method is called when this bean is removed from
         * session scope.  Typically, this occurs as a result of
         * the session timing out or being terminated by the application.</p>
         * <p>You may customize this method to clean up resources allocated
         * during the execution of the <code>init()</code> method, or
         * at any later time during the lifetime of the application.</p>
        @Override
        public void destroy() {
         * <p>Return a reference to the scoped data bean.</p>
         * @return reference to the scoped data bean
        protected ApplicationBean1 getApplicationBean1() {
            return (ApplicationBean1) getBean("ApplicationBean1");
        public Booking[] getBookingArray() {
             List<Booking> bookingList = bookingDAO.findAll();
             if (bookingList != null) {
                 bookingArray = bookingList.toArray(new Booking[0]);
             } else {
                 bookingArray = null;
             return bookingArray;
        public Quota[] getQuotaArray() {
             List<Quota> quotaList = quotaDAO.findAll();
             if (quotaList != null) {
                 quotaArray = quotaList.toArray(new Quota[0]);
             } else {
                 quotaArray = null;
             return quotaArray;
    }

  • ADF Faces: When to expect production ready JSF components

    I know this question has been asked many times, but there is no up to date information as to schedules. What are the time lines for releasing ADF faces components into production?
    Great things have been promised in demos at JavaOne and the like. In particular rich tables generated from AJAX JSF.
    I have seen webcasts promising the components by fall. Well September is close approaching, does this mean we should see the complete set of JSF components imminently?

    Thanks for your response. However, I have previously been through all the examples and am familiar with the functionality that af:table provides.
    I have a set of data intensive applications to write that require data entry in a tabular form for speed.
    Now I know af:table allows them to do this, but some functions such as keyboard cursor key navigation is none-existent.
    My question was what functionality would the richer table control have and how easy would it be to convert to this new component once available.
    Many thanks.

  • Right Ajax component library to use with netbeans

    Hi,
    I am using netbeans for my jsf development. I downloaded the Blueprint Ajax Component and Dynamic
    Faces for Ajax Functionality. I am looking for functionality where i can update a Panelgroup with new
    UI components without refreshing the whole page. Is it possible to do this with Dynamic Faces ? Is there a different Ajax library that i can use with netbeans that would provide this functionality ?
    Thanks
    mohan

    Hi,
    as far as I remember, Tobago is not compatible with JSF 1.2. I worked with Oracle's ADF over a year ago and I remember, that we had some compatibility problems. And if I also recall correctly, Trinidad is the "JSF compatible" version of ADF. ADF was donated by Oracle to the Apache foundation and is now called "Trinidad". You can use both "MyFaces" and "Trinidad" components within the same webapp. That should give you enough components to work with.
    Hope, that helps.
    Cheers,
    Joerg

  • Best practices for adding components in a composite custom component

    Hello,
    I am developing a custom, composite JSF component need to dynamically add child components in my renderer class. I've noticed that people add components to a custom component in many different ways. I'd like to follow JSF best practices when developing this component - of the following approaches, which would you recommend? Or is there yet another approach I should be using?
    1) in the encodeBegin method of my renderer class, create a new component, add it to the component tree, and let the page life cycle take care of the rendering:
    HtmlDataList dimensionStateGroupDataList = (HtmlDataList) app.createComponent( HtmlDataList.COMPONENT_TYPE );
    //set properties on dimensionStateGroupDataList
    component.getChildren().add(dimensionStateGroupDataList);
    2) in either the encodeBegin or encodeEnd method, create a component and encode it:
    HtmlDataList dimensionStateGroupDataList = (HtmlDataList) app.createComponent( HtmlDataList.COMPONENT_TYPE );
    //set properties on dimensionStateGroupDataList
    dimensionStateGroupDataList.encodeBegin();
    dimensionStateGroupDataList.encodeEnd();
    Both of these methods are functional, and I prefer the first (why encode children if you don't have to?), but I am interested in other people's take on how this should be done.
    Thanks for your help.
    -Christopher

    My bad, sorry, wasnt concentrating, Im afraid I have no experience with portlets, but I would have thought that you can mimic the outputLinkEx in you renderer by encoding your own links?
    If you were to bind a backing bean variable to an outputLinkEx what would it be? Not understanding portlets, or knowing what an outputLinkEx is may be hindering me, but you should be able to create an instance of it in code like (this example uses HtmlOutputLink, you would need to know which component to use):
    HtmlOutputLink hol = new HtmlOutputLink();
    hol.set....Then set any attributes on it, and explicitly call its encodeStart, encodeEnd functions. Is that way off the mark.

  • Af:forEach statement causing other jsf components to be repeated

    Hi,
    I am experiencing the same problems as recorded in the following log:
    JSF af:forEach is looping also tags outside of af:forEach
    I have replaced my af:forEach tag with af:iterator which works with the number of items coming back changing dynamically (and therefore does not cause the display issues), however I can't display the iterator results in the same way as for the forEach loop.
    I am trying to get the iterator output displayed in a 3 by 3 grid, but the panel grid does not seem to recognise the iterator output as separate cells but just one continual line.
    Does anyone have any ideas as to how I can achieve the above?
    Thanks,
    Dave

    Hi Frank,
    Thanks so much for replying.
    The code that is causing me problems is as follows:
    <h:panelGrid width="335" columns="3">
    <af:forEach var="row" items="#{bindings.WsWanalItemsView1.rangeSet}">
    <af:panelGroup layout="vertical">
    <af:commandLink action="#{backing_catalogue.selectProduct_action}">
    <af:objectImage
    source="http://#{res[\'filehandling.ip_address\']}/FileHandling/imageScale
    ?entity=STY&type=THUMB&image=#{row.Stycode}&pic=thumb&X=100&Y=100
    &subtype=NONE&subentity=NONE"
    height="137" width="104"/>
    <af:setActionListener from="#{row.Stycode}"
    to="#{processScope.ParamStyCode}"/>
    <af:setActionListener from='#{\"NONE\"}'
    to="#{processScope.ParamSubEntityType}"/>
    <af:setActionListener from='#{\"NONE\"}'
    to="#{processScope.ParamSubEntity}"/>
    </af:commandLink>
    <af:panelHorizontal>
    <af:commandLink text="#{row.Thumbcomment}"
    inlineStyle="font-size:9.0pt;"
    action="#{backing_catalogue.selectProduct_action}">
    <af:setActionListener from="#{row.Stycode}"
    to="#{processScope.ParamStyCode}"/>
    <af:setActionListener from='#{\"NONE\"}'
    to="#{processScope.ParamSubEntityType}"/>
    <af:setActionListener from='#{\"NONE\"}'
    to="#{processScope.ParamSubEntity}"/>
    </af:commandLink>
    <af:objectSpacer width="1" height="16"/>
    </af:panelHorizontal>
    </af:panelGroup>
    </af:forEach>
    </h:panelGrid>
    The forEach statement is bound to a table that brings back product Id's (9 at a time), which are then put into the source url for an object image to display the relevant image. There is also a caption hyperlink displayed underneath the image.
    The forEach statement is placed in a panelGrid so that the images are displayed as a 3x3 grid.
    The image itself is a link that when selected runs code that executes a query, displaying information related to the selected image.
    This all works really well, however if I select an image and display its details, then change another parameter on the page that means different product ids are returned, then select to see details for another image then multiple JSF components on the screen (they all seem to come after the forEach statement) are displayed twice.
    After much digging I found the following statements:
    "changes from one request to the next. It may be possible to work around this in some scenarios by manually deleting all the children of the parent component (e.g., af:selectOneListbox in the code sample below), but this has not yet been tested. "
    and
    "Unlike the af:forEach tag, the af:iterator tag implements an iteration that works with a JSF DataModel or CollectionModel, and can be bound to EL expressions that use EL variables created by components."
    Therefore I have tried to use an af:iterator instead. By changing my af:forEach for an af:iterator I no longer get the duplication issues mentioned above, but I'm having trouble displaying the output of the iterator in a panel grid. I.e. 3x3 images each with a label underneath. It's as if it treats the output of the iterator as a single component.
    This is causing me serious problems so your help on this issue would be greatly appreciated.
    Thanks,
    Dave

  • JSF components within jsf components programatic

    I am using the java sun pane_tabbed component on a jsf page and I want another jsf page to be the tab body. I tried to include another jsp page but that doesn't work. The include in the example something like
    <h:panelGroup>
    <h:outputText value="here is some info to display on tab "/>
    </h:panelGroup>
    It seems I just can't say
    <h:panelGroup>
    here is some info to display on tab
    </h:panelGroup>
    This remind me of servlet days where everything was out.println and why we came up with jsp in the first place and I figure there's got to be a better way.
    So what's the way? I understand I could make the inner html another jsf tag but thats overkill for what I am trying to do. Also I need the inner html to be treated itself like an entirely different page (like a component) so just to put outputText around everything just wouldn't work.
    So what's the way

    In addition.... I understand that part of the JSF concept is that the client can be many different devices and depending on which client different widgets get displayed. A way that that could still be true is that I register a components in faces-config.xml by specifying that it is a jsp page (with jsf components). Then a jsf tree is built with the widgets I have included on the jsp page. Then I specify that the renderer is a jsp page renderer which would mean for my application it would display the jsf page like I wanted with the components where I wanted them. Then if I want to render on for instance a swing application I then need to program a renderer which says how to display these widgets there.
    I'm pretty new to JSF but I'm hoping that I am on the right track here. There should be some way for non java developers to help with the creation of components I would think.

  • JSP 2.0 tag files for rendering JSF components

    Over the weekend I read up on new JSP 2.0 features (dunno why I waited this long??) ... I really liked the tag file feature ...
    I was wondering if it were a good idea to use these tag files as renderers for JSF components - ok, this ties us to a JSP only solution but how many in here would be using a non-JSP solution anyway?
    I was thinking along the foll. lines:
    <myComponent id="myComponent1" attr1="value1" attr2=value2">
        <myComponentRenderer var="myComponent1" />
    </myComponent>
    myComponentRenderer can be implemented as a tag file in myComponentRenderer.tag ... The myComponent tag delegates the business logic processing to its associated UIComponent and then sets this component as a pageContext attribute with the id "myComponent1" ... myComponentRenderer in turn gets a reference to this UIComponent and renders it ...
    Again, if one wants a different way of rendering, make another tag file myComponentRenderer2.tag or change myComponentRenderer.tag itself ...
    Indeed, this may not work for components with complicated rendering logic but I believe that's only the 20% case ...
    Comments?
    P.S.:
    I've picked this up from http://forums.java.sun.com/thread.jsp?forum=427&thread=381052&tstart=0&trange=15
    This also compliments another topic: http://forums.java.sun.com/thread.jsp?forum=427&thread=413515&tstart=0&trange=15

    You are right in saying that decoding has nothing to
    do with rendering per se.I will go even further than Erik did, and dispute this statement.
    Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
    The "renderer" really does
    two completely different things. But both should
    nevertheless be separate from the component
    implementation itself. You could still have the
    renderer doing the decoding part, which arguably would
    rarely change, and somehow delegate the actual
    rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
    Craig

  • Nesting/Nested JSF components

    Please excuse what should be a rudimentary question, but I can't seem to find any documentation on how to nest JSF components.
    For example, given the following objects:
    public class Order {
       private Address deliveryAddress;
       private Address billingAddress;
       //getters and setters...
    public class Address
        private String street;
        private String city;
        //getters and setters...
    }and the jsf managed beans:
    public class OrderModel {
        private Order order;
        // getters/setters and  jsf state, handlers, etc ...
    public class AddressModel {
       private Address address;
       // getters/setters and jsf state, handlers, etc ...
    }with faces-config.xml:
        <managed-bean>
            <managed-bean-name>orderModel</managed-bean-name>
            <managed-bean-class>OrderModel</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
        <managed-bean>
            <managed-bean-name>addressModel</managed-bean-name>
            <managed-bean-class>AddressModel</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
    ...So, my question is, how can I go about writing a reusable order and address component so I can call nest the address component within my order template?
    I guess I'm looking for something like (just a guess - not actual working code):
    order-template.jspx:
    <f:view xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:ui="http://java.sun.com/jsf/facelets">
    Delivery Address:<br/>
        <ui:decorate template="address-template.jspx">
    <!-- can I pass in #{orderModel.order.deliveryAddress} here? -->
        </ui:decorate>
    Billing Address:<br/>
        <ui:decorate template="address-template.jspx">
    <!-- can I pass in #{orderModel.order.billingAddress} here? or use something other than ui:decorate? -->
        </ui:decorate>
    </f:view>
    address-template.jspx:
    <f:view xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:ui="http://java.sun.com/jsf/facelets">
    street:<h:inputText value="#{addressModel.address.street}" />
    city:<h:inputText value="#{addressModel.address.city}"  valueChangeListener="#{addressModel.onCityChanged}"/>
    </f:view>I'm guessing the solution lies in having the OrderModel contain an AddressModel for the delivery and billing address, then pass #{orderModel.deliveryAddressModel} and #{orderModel.billingAddressModel} into the address template.
    So really my question is simply how do I pass those objects into the address-template.jspx?
    Many many thanks in advance!

    You want to use <ui:include> instead of <ui:decorate>. E.g.
    Delivery Address:<br/>
    <ui:include src="/WEB-INF/includes/address-template.jspx">
        <ui:param name="address" value="#{orderModel.order.deliveryAddress}" />
    </ui:include>
    Billing Address:<br/>
    <ui:include src="/WEB-INF/includes/address-template.jspx">
        <ui:param name="address" value="#{orderModel.order.billingAddress}" />
    </ui:include>Then you can refer to #{address} within address-template.jspx.
    Be aware however that Facelets is not particularly careful about protecting namespaces with includes and such. This won't be a problem if you use a unique name for the parameter.

  • Mixing Non JSF and JSF components

    Hi All,
    I wanted to mix non jsf and jsf components and I able to do this
      <f:verbatim>
                                    <input type="radio" name="selectBidder" value="#{currentRow['BID_ID]}"/>
                                </f:verbatim>But the problem is bean value is not getting binded.
    The rendered output is containing same string i.e.
    value="#{currentRow['BID_ID]}"
    How to bind bean value to non jsf component.
    And No Javascript please
    Thanks
    Sudhakar

    Basically I am trying to implement something like below
    <h:dataTable binding="#{consumer$Select_Provider.dataTable1}" headerClass="list-header" id="dataTable1"
                            rowClasses="list-row-even,list-row-odd" style="left: 48px; top: 48px; position: absolute"
                            value="#{consumer$Select_Provider.dataTable1Model}" var="currentRow">
                            <h:column binding="#{consumer$Select_Provider.column6}" id="column6">
                                <h:outputText binding="#{consumer$Select_Provider.outputText11}" id="outputText11" value="#{currentRow['USER_LNAME']} #{currentRow['USER_FNAME']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{consumer$Select_Provider.outputText12}" id="outputText12" value="Bidder"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{consumer$Select_Provider.column1}" id="column1">
                                <h:outputText binding="#{consumer$Select_Provider.outputText1}" id="outputText1" value="#{currentRow['BID_PRICE']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{consumer$Select_Provider.outputText2}" id="outputText2" value="Bid Price"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{consumer$Select_Provider.column3}" id="column3">
                                <f:verbatim>
                                    <input name="selectBidder" type="radio" value="#{currentRow['BID_ID]}"/>
                                </f:verbatim>
                                <f:facet name="header">
                                    <h:outputText binding="#{consumer$Select_Provider.outputText6}" id="outputText6" value="Select Bidder"/>
                                </f:facet>
                            </h:column>
                        </h:dataTable>Thanks
    Sudhakar

  • Authorization in JSF based on permission of a component

    Hello,
    I am trying to render components based on a permission.
    so let say that
    there are following permissions
    Admin
    Application-Read
    Application-Write
    Development
    I need to set a permission for each component on a page.
    Some user can only see the components that are ready only, others can see components that are for read/write users, and Admin person can see all the components that are on the page.
    How would i do that in JSF. I have couple ideas that i am doing now, but i know that there are experts that have done this, and there must be an easy way of doing it.
    I was thinking of extending my jsf components and add a attribute permission where i would be able to specify one ore more permission for each component(permissionAtt ("Admin,Application-Read"))
    based on that i would then render the component by calling something like isAuthorized, which would check the permission of the user and the permission of the component. and then render it if it's true.
    but this would mean that i have to modify a lot of components.
    is there a easier way of doing this .
    Thank you so much JSF experts
    Robert

    Your custom component idea is a good one. That's probably the best solution for this... However, there's perhaps an easier ways to do this without having to create a custom component. It is less work as well.
    Assuming you know the authorization level of the current user... It is very easy to use the existing rendered attribute on the JSF tags.
    I would suggest creating an authorization bean, or something similar, that contains a few booleans. You could have a boolean that exists for each level of authority (Admin, Application-Read, Application-Write, Development). In the constructor of the authorization bean, simply set the authority booleans appropriately to the level of authorization for the user.
    For example, if your user has Admin level authority, you would set all the booleans to true. But if they only had read authority, you could set all the booleans to false, except Application-Read.
    Then create a getter for each boolean in the authorization bean.
    On your JSPs, use the rendered attribute of each tag to check for the appropriate authority level in the authorization bean. For example, if you have an inputText that can only be used by Admin level user, you'd only render the inputText if the admin boolean in the authorization bean is true.
    Clear as mud?
    CowKing

  • NotSerializable exception from JSF components

    Hi All
    I have a JSF application deployed in WAS in a clustered environment,
    The problem is , in clustered environment the session manager tries to write the session object , so that if one machine goes down the other can pick it up, now i get an Exception that the JSF components are not serializable. i dont know why is this happening.
    below is the Stack trace
    6/7/07 11:07:10:721 EDT] 000000ee SessionContex E Exception is: java.io.NotSerializableException: javax.faces.component.html.HtmlSelectManyListbox
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined Compiled Code))
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java(Compiled Code))
    at com.ibm.ws.webcontainer.httpsession.BackedHashtableMR.handlePropertyHits(BackedHashtableMR.java(Compiled Code))
    at com.ibm.ws.webcontainer.httpsession.BackedHashtable.persistSession(BackedHashtable.java:2307)
    at com.ibm.ws.webcontainer.httpsession.BackedHashtable.ejbStore(BackedHashtable.java:2501)
    at com.ibm.ws.webcontainer.httpsession.BackedHashtable.storeSession(BackedHashtable.java:2143)
    at com.ibm.ws.webcontainer.httpsession.BackedHashtable.put(BackedHashtable.java:2776)
    at com.ibm.ws.webcontainer.httpsession.DatabaseSessionContext.sync(DatabaseSessionContext.java:164)
    at com.ibm.ws.webcontainer.httpsession.SessionData.releaseSession(SessionData.java:289)
    at com.ibm.ws.webcontainer.httpsession.SessionContext.sessionPostInvoke(SessionContext.java:2860)
    at com.ibm.ws.webcontainer.srt.SRTRequestContext.finish(SRTRequestContext.java(Compiled Code))
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.finish(SRTServletRequest.java:1359)
    at com.ibm.ws.webcontainer.srt.SRTConnectionContext.finishConnection(SRTConnectionContext.java:75)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:2041)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:89)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
    Any help is appreciated a lot...
    Thanks in advance

    I'm guessing that you have a session level backing bean that has a property that is bound to an HtmlSelectManyListbox instance via the binding attribute.
    You can address this in the following ways: 1) make the bean request scope; 2) make the property transient in the bean or 3) remove the binding. My first instinct would be 1), while 2) sounds quick and easy I suspect it will cause problems. 3) obviously requires some rewriting.

  • Most reliable AJAX component library

    Guys... I'm thinking to you ajax component with my JSF app. I'm wondering which component library I should choose. Could you please share your experience which one is the most reliable.
    I have used jboss's ajax4jsf and another ajaxtag library. They both are great, but sometime occasionally they just broken and response nothing. I feel like not reliable. Could you share your experience?

    thanks for the reply. i believe you are talking about apache trinidad. Do you like that one? The live demo is not very attractive though, but I'll try it by myself.
    Is there any other suggestion? or do u have any idea why ajax functions are broken sometime?

  • Can I write Design-time for JSP custom tag(not JSF components)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • How to standardize the look & feel of different vendor JSF components?

    Hi,
    There are various JSF components created by different parties. For example, Tomahawk from Myfaces, ADF faces from Oracle, SUN components that provided in Java Studio creator. They look different.
    Can we standard the look and feel for these various components when we use them in a same project? so that it wouldn't look that different when the page is displayed to the end user.
    Please advise.
    Thank you.

    Hi,
    Can you be more specific how to achieve that using css? You mean the look and fee that we see is not an image?
    Have you seen how Oracle ADF face look & feel is like?
    How to change its look to what we have SUN offered in its Java studio creator 2?
    Please advise.
    Thank you.

Maybe you are looking for

  • Oracle reports 10 in windows 7 will not open.

    I just installed Oracle reports 10 on a windows 7 pc. It open once. I updated my tnsnames with the following # tnsnames.ora Network Configuration File: C:\DevSuiteHome_1\network\admin\tnsnames.ora # Generated by Oracle configuration tools. EXTPROC_CO

  • Oracle Data Loader On Demand on EHA Pod

    Oracle Data Loader doesn't work correctly. I downloaded it from Staging(EHA Pod). And I did the following work. 1.Move to "config" folder,and update "OracleDataLoaderOnDemand.config". hosturl=https://secure-ausomxeha.crmondemand.com 2.Move to "sample

  • Can mac mini entry level (mid 2011) support 3 monitors? or only 2? please help!

    can mac mini entry level (mid 2011) support 3 monitors? or only 2? please help!

  • Transfer everything on macbook pro to an imac

    I would like to transfer everything on my macbook pro over to an imac i have. Both machines are running snow leopard. By everything i mean photos, itunes library, everything. I don't care if everything on the imac is lost or not as long as the macboo

  • Is a separate licence required for clustering?

    Hi.           Is a clustering licence required for Weblogic 6.1? Using the downloaded           bits, can we not setup even a simple cluster? In short, what are the           limitations of the download bits?           Thx,           - deepak