JSF Framework Design

Hi,
I need to create an application on Jsf technology but I am new to jsf ,
Does any one has some JSF application working.
Please mail me the documentation of framework for JSF technology.

http://www.google.com/search?q=jsf+tutorial

Similar Messages

  • In JSF framework application how to Insert data into DB using entitymanager

    Dear friends,
    I am developing a web application using JSF framework. In that i using entity class. In ManagedBean class i want to insert the data using entitymanager persist method. But it will not working. And don't show any errors. give me the suitable methode to insert data into the database using EntityManager.Persist() method.

    Yes, Panky_p,
    i have attached the code for which i using in given below. In that am getting the data from database but only the problem is not inserting into the database.Give me the possible solution for that.Thank you
    public String ValidUser(String username, String password) {
    List<User> us = new ArrayList();
    EntityManager em = getEntityManager();
    try {
    us = em.createNamedQuery("User.findAll").getResultList();
    if (us != null) {
    Iterator i = us.iterator();
    while (i.hasNext()) {
    User use = (User) i.next();
    if (username.equals(use.getHmsusrloginName()) && password.equals(use.getHmsusrpassWord())) {
    utx.begin();
    Logindetail lo = new Logindetail();
    lo.setHmslogusrId(use.getHmsusrusrId());
    lo.setHmslogloginName(use.getHmsusrloginName());
    lo.setHmslogtimeIn(getCurrentDate());
    em.persist(lo);
    utx.commit();
    return "success";
    return "failure";
    } else {
    return "failure";
    } catch (Exception ex) {
    System.out.println("Exception in GetConnection " + ex);
    return "failure";
    }

  • Custom mapping is obviously not reflected in the Entity Framework designer

    Hi,
    I use the Oracle Data Provider for .NET 11.2.0.2.50 Beta 3 with the Entity Framework. I added a custom mapping to the app.config that maps NUMBER(1,0) to bool:
    <oracle.dataaccess.client>
    <settings>
    <add name="bool" value="edmmapping number(1,0)" />
    </settings>
    </oracle.dataaccess.client>
    When I create an Entity Framework model from my Oracle database the EF designer uses Int16 for NUMBER(1,0) fields instead of bool. If I run the program I then get an exception (as expected):
    "Schema specified is not valid. Errors:
    EntityFrameworkTest.msl(7,12) : error 2019: Member Mapping specified is not valid. The type 'Edm.Int16[Nullable=True,DefaultValue=]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.CUSTOMER' is not compatible with 'OracleEFProvider.number[Nullable=True,DefaultValue=,Precision=1,Scale=0]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.Store.CUSTOMERS'."
    Okay. Assuming it's an error in the EF designer, I set the type Boolean in the model myself for the NUMBER(1,0) fields. But that gives me a compilation error:
    "Error 2019: Member Mapping specified is not valid. The type 'Edm.Boolean[Nullable=True,DefaultValue=]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.CUSTOMER' is not compatible with 'OracleEFProvider.number[Nullable=True,DefaultValue=,Precision=1,Scale=0]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.Store.CUSTOMERS'."
    Is this a bug in the provider? Or am I missing something?

    Are you using model first or database first? If you're using database first, make sure you update the model from the database after adding that configuration.
    Also, if your model is in a different assembly (ie a different project) from your executable, your executable project's configuration file also needs the mapping section.
    Finally... there's been a LOT of threads about this not working properly in beta 3. I'm still on beta 2 and except for some incorrect error messages in the designer it works fine (I get fake errors). If nothing else works, I might suggest trying beta 2 as a last resort.

  • Problem doing JSF tutorial - design view not working

    Hi everyone.
    I am fairly new to Java and followed the tutorial bellow to styart learning about it.
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/adf_richclient/adfrichclient.htm#o
    I managed to finish the tutorial using the structure explorer because the design view wasn't working for me. Whenever I make a JSF Template and use it to make another JSF page, the design view does not shows the facet I've added, thus I cannot put any components using the design view. I basically fail to get the screen shown at #4 of the "Create a Page Using the Page Template" section in the tutorial.
    Am I missing a configuration or something ?
    Thanks.

    I tried looking at the logs (with the option on) and didn't see anything. I'll continue to investiguate on this.
    Here is the template code followed by the "child" page code. On the page code, I can't put anything inside the facet using the designer, but using the structure, I can.
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <af:pageTemplateDef var="attrs">
    <af:decorativeBox id="pt_db1">
    <f:facet name="center">
    <af:panelSplitter id="pt_ps1" orientation="vertical"
    splitterPosition="25" positionedFromEnd="true">
    <f:facet name="first">
    <af:panelSplitter id="pt_ps2">
    <f:facet name="first">
    <af:panelAccordion id="pt_pa1">
    <af:showDetailItem text="showDetailItem 1" id="pt_sdi1"/>
    </af:panelAccordion>
    </f:facet>
    <f:facet name="second">
    <af:facetRef facetName="content"/>
    </f:facet>
    </af:panelSplitter>
    </f:facet>
    <f:facet name="second"/>
    </af:panelSplitter>
    </f:facet>
    <f:facet name="top"/>
    </af:decorativeBox>
    <af:xmlContent>
    <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
    <display-name>master</display-name>
    <facet>
    <facet-name>content</facet-name>
    </facet>
    <attribute>
    <attribute-name>Title</attribute-name>
    <attribute-class>java.lang.String</attribute-class>
    <default-value>*Default Title</default-value>
    </attribute>
    </component>
    </af:xmlContent>
    </af:pageTemplateDef>
    </jsp:root>
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:pageTemplate viewId="/templates/master.jspx"
    value="#{bindings.pageTemplateBinding}" id="pt1">
    <f:facet name="content"/>
    </af:pageTemplate>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Edited by: 833334 on Feb 2, 2011 2:28 PM --> Replaced with smaller code that has the same issue.

  • How is the processing speed while using struts,spring,and JSF framework

    Hi friends,
    As per earlier technology like Servlets,I mean that there would have much more performance speed than other new technologies like JSP,struts,spring and hibernate framework.Because,in new technologies,flow of processings implicitly via MVC2 basis will probably much more time than older one.
    Total goal is only for attaining MVC2 or any other purpose?
    Please clarify my doubt?
    With Regards,
    Stalin.G

    Home grown applications have a problem in that as more and more features are added, it becomes increasingly impossible to maintain the application and enhance it. This is especially true when the original programmers leave the company. A framework provides a standard design approach that other programmers can hopefully more easily pick up.
    A lot of work has gone into creating these frameworks and they have been used in web sites that have millions of hits from users per day. They have high preformance. Of course, programmers can still write bad code in them that slows down the system. I believe anyone using these frameworks should study them well before using them (such as reading books on them).

  • Using facelets and Visual web jsf frameworks together

    I am developing a new jsf application and I wanted to make the page navigation simpler like making the content pages independently using woodstock components and including them in the main template page.
    I have downloaded Facelets support plugin for netbeans and installed it. I have created a new project using the wizard and i specified the two (facelets and visual web jsf) as frameworks for use. But I failed to leverage my application with facelets because I don't know how to use woodstock components with facelets.
    I am new to jsf and i want the woodstock visual components. Can't I use facelets then?
    Plz help.

    I managed to find a workaround. Thought i should share it with those who are faced with a similar issue.
    I found that a bug report had been placed in the past with Apache Dev. However, they had said that they would not modify their logic because the servlet container spec requires it (even though isapi_redirector is only a connector and not a container). They said that there is no way for the isapi_redirector to differentiate between /foo/WEB-INF when foo is a context and when foo is just a sub-directory of the ROOT web application. So, the general consensus was to err on the side of safety and risk blocking a few requests that are valid.
    However, this causes a serious issue for those using NetBeans JSF Visual Web Projects. Hence, I created my own flavour of isapi_redirector by modifying the code such that this check is not performed and leaving the onus of checking on Tomcat.
    For those who are interested, the simplest way to go about this would be to force the function uri_is_web_inf (in jk_isapi_plugin.c ) to always return FALSE.

  • JSF/JSP design view not displaying correctly

    Hi there
    I am using jdeveloper version Studio Edition Version 11.1.1.3.0 on windows 7. When I create a 3 column layout JSF page , the design view does not show 3 columns (This used work properly). Instead
    it shows .
    - <>/oracle/templates/threecolumnTemplate.jspx
    I am used to seeing 3 columns start,middle and end (in blue). I have not changed any configuration settings.
    regards

    What does the source tab shows? what's the actual code of your page?

  • ValueList JSF Wrapper design help needed...

    I need some help here....
    I am trying to write a JSF wrapper for valuelist (http://valuelist.sourceforge.net) which would use the backend integration already contained in ValueList to leverage as a JSF component.
    In traditional implementation ValueListInfo could be reconstructed from request parameters. I am unclear how I can reconstuct ValueListInfo in the JSF way. I need a way to get the current page number the datatable is attempting to display to the procedure that returns the datamodel.
    Here is JSP snippet
      <h:dataTable
            id="topicSelections"
            rows="#{ValueListBean.topicSelectionsRowsPerPage}"
            value="#{ValueListBean.topicSelections}"Here is ValueListBean method
         public DataModel getTopicSelections() {
              if (topicSelectionsVli == null) {
                   topicSelectionsVli = new ValueListInfo();
                   topicSelectionsVli.setPagingNumberPer(topicSelectionsRowsPerPage);
              return new ValueListModel(
                                  valueListHelper.getValueListHandler().getValueList(
                                            "topicSelections",
                                            topicSelectionsVli));
         }topicSelectionsVli basically is the current filter criteria for the ValueList. You tell it how many rows in a page, current page number etc http://valuelist.sourceforge.net/apidocs/net/mlw/vlh/ValueListInfo.html and it gets a valuelist for the currently displayed page.
    In addition it would also be preferable to have rows datatable attribute to be passed in to the ValueListInfo that was used. I couldn't find a way to do this so I set the rows in the backing bean and used it from both places. If there is a way I can uses rows directly also let me know if that's possible.

    I have coded something that works the problem now is that there are 2 trips being made to db because in each request the model needs to be assigned to the datatable component and I can't see a way to tell model the current parameters so I can initialize with those parameters instead. Is there a way to do this short of making backing bean a session bean? Also I couldn't tell a way to cause wrap procedure to run after all the IoC injections have occured. Here is the code.
           <managed-bean>
           <managed-bean-name>TopicSelections</managed-bean-name>
           <managed-bean-class>com.bcbsma.jsf.model.ValueListModel</managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
            <property-name>valueListHelper</property-name>
            <value>#{valueListHelper}</value>
            </managed-property>
           <managed-property>
            <property-name>valueListTableName</property-name>
            <value>topicSelections</value>
           </managed-property>
           <managed-property>
            <property-name>pagingNumberPer</property-name>
            <value>1</value>
           </managed-property> 
         </managed-bean> And here is backing bean
    package com.bcbsma.jsf.model;
    import java.util.Iterator;
    import javax.faces.FacesException;
    import javax.faces.model.DataModel;
    import javax.faces.model.DataModelEvent;
    import javax.faces.model.DataModelListener;
    import net.mlw.vlh.ValueList;
    import net.mlw.vlh.ValueListInfo;
    import net.mlw.vlh.web.mvc.ValueListHandlerHelper;
    * @author jztb88
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class ValueListModel extends DataModel {
         private ValueListHandlerHelper valueListHelper;
         private String valueListTableName;
         private ValueListInfo valueListInfo;
         private Iterator valueListIter;
         public void setValueListHelper(
                   ValueListHandlerHelper valueListHelper) {
              this.valueListHelper = valueListHelper;
          * @param valueListTableName The valueListTableName to set.
         public void setValueListTableName(String valueListTableName) {          
              this.valueListTableName = valueListTableName;     
          * @param pagingNumberPer The pagingNumberPer to set.
         public void setPagingNumberPer(int pagingNumberPer) {
              if (valueListInfo == null) {
                   valueListInfo = new ValueListInfo();               
              valueListInfo.setPagingNumberPer(pagingNumberPer);
            setWrappedData(valueListHelper.getValueList(valueListTableName,valueListInfo));
          * @return Returns the pagingNumberPer.
         public int getPagingNumberPer() {
              return valueListInfo.getPagingNumberPer();
         * <p>Construct a new {@link ValueListModel} with no specified
         * wrapped data.</p>
         public ValueListModel() {
              super();
        // ------------------------------------------------------ Instance Variables
        // The current row index (zero relative)
        private int index = -1;
        // The list we are wrapping
        private ValueList valueList;
         * <p>Return <code>true</code> if there is <code>wrappedData</code>
         * available, and the current value of <code>rowIndex</code> is greater
         * than or equal to zero, and less than the size of the list.  Otherwise,
         * return <code>false</code>.</p>
         * @exception FacesException if an error occurs getting the row availability
         public boolean isRowAvailable() {
            if (valueList == null) {
                 return (false);
            } else if ((index >= 0) && (index < getRowCount())) {
                return (true);
            } else {
                return (false);
         * <p>If there is <code>wrappedData</code> available, return the
         * length of the list.  If no <code>wrappedData</code> is available,
         * return -1.</p>
         * @exception FacesException if an error occurs getting the row count
         public int getRowCount() {
            if (valueList == null) {
                 return (-1);
            return (valueList.getValueListInfo().getTotalNumberOfEntries());
         * <p>If row data is available, return the array element at the index
         * specified by <code>rowIndex</code>.  If no wrapped data is available,
         * return <code>null</code>.</p>
         * @exception FacesException if an error occurs getting the row data
         * @exception IllegalArgumentException if now row data is available
         *  at the currently specified row index
         public Object getRowData() {
            if (valueList == null) {
                 return (null);
            } else if (!isRowAvailable()) {
                throw new IllegalArgumentException();
            } else {
                return (valueList.getList().get(index % valueListInfo.getPagingNumberPer()));
         * @exception FacesException {@inheritDoc}    
         public int getRowIndex() {
            return (index);
         * @exception FacesException {@inheritDoc}
         * @exception IllegalArgumentException {@inheritDoc}
         public void setRowIndex(int rowIndex) {
              if (rowIndex < -1) {
                   throw new IllegalArgumentException();
              int old = index;
              index = rowIndex;
              if (valueList == null) {
                   return;
              DataModelListener[] listeners = getDataModelListeners();
              if ((old != index) && (listeners != null)) {
                   Object rowData = null;
                   if (isRowAvailable()) {
                        int oldPage = valueListInfo.getPagingPage();
                        valueListInfo.setPagingPageFromRowNumber(index);
                        int newPage = valueListInfo.getPagingPage();
                        if (oldPage != newPage) {
                           valueList = valueListHelper.getValueList(valueListTableName,valueListInfo);
                        valueListInfo.setFocusedRowNumberInTable(index);
                        rowData = getRowData();
                   DataModelEvent event = new DataModelEvent(this, index, rowData);
                   int n = listeners.length;
                   for (int i = 0; i < n; i++) {
                        if (null != listeners) {
                             listeners[i].rowSelected(event);
         * (non-Javadoc)
         * @see javax.faces.model.DataModel#getWrappedData()
         public Object getWrappedData() {
    return (this.valueList);
    * @exception ClassCastException if <code>data</code> is
    * non-<code>null</code> and is not a <code>List</code>
         public void setWrappedData(Object data) {
    if (data == null) {
    valueList = null;
    setRowIndex(-1);
    } else {
    valueList = (ValueList) data;
    index = -1;
    //setRowIndex(0);
    Here is the jsp stuff
      <h:dataTable
            style="width:250"
            styleClass="disp"
            id="topicSelections"
             rows="#{TopicSelections.pagingNumberPer}"
            value="#{TopicSelections}"
            var="contactUsTopic"
      >

  • Suggestion for the JSF framework team.

    We Neeeeeeeeeeeeed tiles/template system in JSF :(
    btw i Hate .net and C# and etc ( and microsoft ) but today i was on the lounch of the new microsoft products CLR 2.0 C# 2.0 bla bla Visual Studio 2005 , Sql 2005 .. etc..
    i see that in ASP.net now there is tiles system it`s called "MASTERs" or somethink like it .. its nice easy to use not like struts tiles in JSF ( i was going crazy until i make them work ).
    So please people SUN rox , Java ROX , JSF RooooooX but we(or I) need template system

    Thanks Jacob,
    Unfortunately I still can't find how to get rid of
    all these <ui:insert name="title"> and
    <ui:define name="body">
    <h:form id="helloForm">
    Could somebody point me on??
    Denis Krukovsky
    http://write-software.blogspot.com/
    Facelets allows the use of jsfc, so in the above example:
    <span jsfc="ui:insert" name="title">Example Title</span>
    <span jsfc="ui:insert" name="body">Example Body</span>
    <form jsfc="h:form" id="helloForm">...You can even experiment with custom decorators which will automatically convert HTML->JSF tags at compilation time.

  • Problem injecting a List of managed beans in JSF framework.

    Is it possible to inject a List of beans as a managedproperty to a managed bean??
    @ManagedProperty(value="#{user}")
         private List<userBean> users;
    Thanks.

    It was possible through faces-config, so I'd say yes. Are you sure 'user' actually resolves into a list? Perhaps you meant 'users' ?

  • Unified Expression language framework in another context than JSP/JSF

    Hi
    +(I hope this is the right place for such question)+
    We are building some RCP apps and we are in need, for our frameworks, of a expression language that allows to get and set values, and other things, and it seems that the Unified Expression Language Framework meets our need.
    However, as I said, this is a RCP app, not a web app. So my question is
    Is this framework designed to be used outside of the web app context (jsp, jsf, etc) ? Or is there any dependencies that would prevent or make it difficult to use it in a GUI RCP application?
    Thanks for your help
    cd

    BalusC wrote:
    It's so cool that you can change the way to read your sentence. I never read it any other way. I probably shouldn't have posted a double meaning statement but saying that I'm changing the way I read it is incorrect. I'm not doing that.
    BalusC wrote:
    It's also a great coincidence that you mention exactly the references which are implicitly available in the scriptlet world.Not sure what that's intended to mean. I was exposing to the OP the part of EL that deals with objects that require/assume a j2ee container.

  • Announce: Guise framework addresses JSF shortcomings

    JSF developers may be interested in learning of the release of a new framework named Guise(TM), which is now available free for development use:
    http://www.javaguise.com/
    I've been involved in the JSF forum for many months, as I spent countless frustrating hours trying to coax JSF into doing what I believed were simple, obvious things. As you can see on this forum, I've written a whole new value-binding expression syntax and framework just so I could pass parameters to methods. I've had to rewrite several JSF renderers just so the output it creates would not break my XHTML files. I've had to create a new component and associated framework just to upload files. I've kept the JSF community updated with my progress, but eventually I found myself rewriting the JSF framework more than I was writing application code. Guise(TM) is the solution I created for my JSF problems.
    I'll admit that I first approached JSF with the wrong mindset, thinking that it was some sort of procedural scripting language like JSP. I soon adopted a component mindset whole-heartedly, only to be disillusioned: although JSF may claim to be definition-file agnostic, in reality it was built on top of JSP and jumps through a thousand crazy hoops just so people can define their components in JSP. Hans Bergsten infamously advocated (see http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html ) dumping JSP to save JSF, but even getting rid of JSF would still leave a framework that scatters type-unsafe strings throughout the source code and multiple configuration files, and provides wildly inefficient event delgation through many error-prone levels of an impotent expression language. That's not even considering finding the right combination of component IDs so that I can send back a validation error that will appear in the correct location on my web page.
    I was getting ready to recommend to one of my clients a framework for their redesigned web application. I pondered what I would recommend---JSP+EJB? Struts? JavaServer Faces? In the end I realized that none of these provide anything close to the simple, safe, robust UI frameworks we're used to working with on the client. I wanted something that can be used like Java Swing, yet is simpler and more elegant, and uses generics. Since I was calling the shots, I decided that I wanted the UI to work on the client or across the web with no code changes.
    So I wrote Guise(TM)---a graphical user interface framework in Java designed from the ground up to be both simple and elegant. Consider this example "Hello User" program, available at http://www.javaguise.com/demonstration
    public class HelloUserFrame extends DefaultFrame
      public HelloUserFrame(GuiseSession<?> session)
        super(session, new FlowLayout(Orientation.Flow.PAGE));
        getModel().setLabel("Guise\u2122 Demonstration: Hello User");
        Label helloUserLabel=new Label(session);
        helloUserLabel.setVisible(false);
        add(helloUserLabel);
        TextControl<String> userInput=new TextControl<String>(session, String.class);
        userInput.getModel().setLabel("What's your name?");
        userInput.getModel().setValidator(new RegularExpressionStringValidator(session, "\\S+.*", true));
        userInput.getModel().addPropertyChangeListener(ValueModel.VALUE_PROPERTY,
            new AbstractPropertyValueChangeListener<String>()
              public void propertyValueChange(PropertyValueChangeEvent<String> propertyValueChangeEvent)
                String user=propertyValueChangeEvent.getNewValue();
                helloUserLabel.getModel().setLabel("Hello, "+user+"!");
                helloUserLabel.setVisible(true);
        add(userInput);
    }No, this isn't Swing---it's Guise. The above example is all type-safe; the only hard-coded strings for this example is a declaration in the web.xml file binding the class to a navigation path. Forget "backing beans". Forget unsafe strings littering a multitude of configuration files. Try Guise, and you be the judge.
    Here are some reasons you may like Guise:
    * No JSP!
    * Allows the web equivalent of modal dialogs.
    * Quick and easy setup.
    * Elegant ultra-MVC, with encapsulated models and controllers. No need for complicated backing beans and inflexible expression language---just use Java like you normally would.
    * Instantiate components, plug in validators, add action listeners, and report errors directly instead of using cumbersome, error-prone, and type-unsafe strings scattered in various configuration files and source code.
    * Java generics supported throughout.
    * File uploads built in.
    * Customizable, robust, authentication and authorization built in. Client-based authentication and login-based authentication can be seamlessly intermixed.
    * Buttons are rendered with real buttons that allow icons and other rich content, and automatically work around the IE button bugs.
    * Output is 100% XHTML compliant, with automatic downgrading from content type "application/xhtml+xml" to "text/html" for buggy clients (such as IE 6) which crash when the W3C specification for XHTML content type is followed.
    * Validation errors are automatically associated with components, and appear automatically on the web page. An error dialog box is also presented indicating the errors.
    * Internationalization is built in. Each application is aware of its supported locales and the selected locale of each session. Set a control model's resource key, and the correct value will automatically be loaded at runtime.
    * Parameters can be sent in the URI query string.
    * Multiple components can share the same model.
    * List selection controls implement the java.util.List interface and support generic values.
    * The Guise framework is thread-safe.
    I realize that although it's likely the release of Guise will be of interest to the JSF community, in-depth discussion of the framework is probably off-topic for the JSF Forum. I welcome further discussion of Guise, along with inquiries, at [email protected] . Further information may be found at http://www.javaguise.com/ .
    Sincerely,
    Garret

    Ed,
    I appreciate your innovation in creating a new
    Framework, I'm of course very interested to hear
    specifics about why you chose to do so. Which
    shortcomings in JSF exactly are you trying to fix?Thanks for the concern. If you look through the posts I've made to this forum, you'll get an idea of the heartache I've went through with JSF. Let me give you an overview. (I've provided appropriate citations to the related forum discussions.)
    Iteration
    One of the big newbie complaints you'll hear is that JSF won't work with JSTL---in particular, the JSTL iterators. I ran into this problem early on, and decried the lack of no iterator replacement. Adam Winer explained all the "pain... pain... more pain" it would take to create an iterator in JSF that would work with other components. After I became experienced with JSF and dug through the source code for months, I pointed out that UIData already goes through all this pain and needs to be refactored---UIData is really a UIIterator with a tad bit of table-specific stuff thrown in. http://forum.java.sun.com/thread.jspa?threadID=557278
    But the complaints and debates about iteration reveal a more fundamental problem with JSF. At its heart it is declarative---a fault it inherits from its close relationship with JSP. Tables, for example, are defined as a static relationship defined forever-in-stone in (for example) a JSP. Because we all want dynamic data in tables, JSF allows us to declare a programmatic relationship between table rows and the table, resulting in secret counters that get incremented and decremented in the background as rendering occurs, along with associated bugs in nested tables. A render phase is simply not the place to put dynamic application logic, but in JSF that's the only place to put it if you follow the paradigm. And you must do the same strange variable counts in the the other phases, just so you can wind up with the correct bindings for the correct row.
    Because JSF forces application logic into the render phase, I have to create something like a UIAssignment component that pretends to be a static component in the hierarchy, yet really performs variable assignment as JSF goes through the rendering process. I have to rely on the implementation rendering in the correct order, and I have to add with intricate logic to work around hidden/visible settings that might alter the rendering procedure and hence defeat the assignment algorithm. http://forum.java.sun.com/thread.jspa?forumID=427&threadID=576178
    Guise is not built on top of JSP, and hence doesn't force one to put rendering-related hacks into the application code. Check out the elegant Guise table model, for instance. It's very similar to the Swing table model, but simpler, more elegant, and with generics. Rather than play with counters and rendering in the application logic, you can just reference Java objects as you would normally. This entire issue of iteration is also related to the "Loose, Late Binding" issue and the "Impotent Expression Language" problem, which I discuss below.
    Loose, Late Binding
    Because JSF uses the "pretend not to be tied to JSP but support JSP in the archictecture" paradigm, the components are so uncoupled from the application code that any event logic must use a separate expression language. This language is not checked until runtime. I could put the string "Bill Murray" in an expression, and I'd never know about the problem until someone tries to access that page. Similarly, any expressions are so loosely bound that I don't know to what extent they actually work with my code until I start up the web server.
    What happens if I want to respond to an event in JSF? Well, first I have to create a "backing bean," a special mediator to help my components and application work together. Then I have to create an un-typesafe string in a non-Java language that binds something that happpens on the component with the backing bean, which will in response do something with my application. Something like:
    <h:commandButton action="#{myBackingBean.doSomething}" value="Test"/>Then (as if this weren't enough) I have to find some configuration file somewhere in order to define my backing bean (it doesn't work automatically). Needless to say, this definition also isn't typesafe and is not verified until runtime. All this just to respond to a button being pressed?
    Guise doesn't need an expression language, backing beans, or backing bean configuration files. If I want to repond to a button being pressed, I just listen for it---right in the Java code:
    myButton.getModel().addActionListener(...)Everything is typesafe (with generics, I might add). If there's a syntax problem, you'll know it when your program doesn't compile. Your code becomes much more efficient because the expression string doesn't have to be parsed, a variable-binding object doesn't need to be created, and a backing bean doesn't need to be looked up every time the page renders. It just works like you expect Java to work. Simple and elegant.
    But the loose, late binding doesn't stop at the expression language. Binding components to IDs in faces-config.xml isn't typesafe. Assigning renderers in faces-config.xml isn't typesafe. In fact, even programmatically creating a component at runtime forces me to use some arbitrary string that isn't tied to anything except some lookup map somewhere that I hope has been properly configured by faces-config.xml and the various components and renderers. Changing component properties at runtime requires several levels of un-typesafe string processing. String, strings, strings---JSF brings Java back to BASIC, as it were.
    If I want to create a component in Guise, on the other hand, I do it like I'd create anything else in Java:
    Label=new Label(session);If I want to associate a controller with a component in Guise, I'm not just passing around opaque strings. Here's a line out of XHTMLControllerKit:
    registerController(Label.class, XHTMLLabelController.class);
    Impotent Expression Language
    It's bad enough that we have to mess with expression languages, but the JSF expression language is impotent that I can't even pass arguments to methods! (The argument that JSP doesn't allow them either falls on deaf ears---JSF isn't tied to JSP, right?) Doing simple things like selecting an item from a list becomes virtually impossible (if you want to keep your elegantly-factored backend code) without argument passing. That's why I was forced to create an entire new expression language on top of JSF-EL just to allow parameters to methods. http://forum.java.sun.com/thread.jspa?forumID=427&threadID=561520 And (combined with the iteration problem, above) I had to create a UIAssignment that pretends to be a component yet really performs variable assignment in the background, using my extended JSF-EL. http://forum.java.sun.com/thread.jspa?forumID=427&threadID=563036
    Internationalization
    Support for internationalization in JSF (and even in Swing) is provided in a sort of ad-hoc, last-minute manner. Guise has internationalization support built in from the ground up. Each component model can be given a resource key, which will automatically get the correct data based upon the session locale.
    Guise handles internationalization of component layout automatically as well. Check out the internationalization demo at http://www.javaguise.com/demonstration ---just by changing the session locale, the entire component hierarchy reorients itself automatically and loads the correct resources. That's done with one line of application code!
    File Uploads
    JSF doesn't support file uploads, and I had to concoct an entire file upload framework for JSF. http://forum.java.sun.com/thread.jspa?forumID=427&threadID=464060
    Guise has elegant, validating file upload support built in.
    In the end, I just wanted to write an application for the web like I would for Swing, without resorting to a mindset of a couple of decades ago when typesafeness was unknown and event delegation wasn't elegant. Since we have Java 5.0, I also wanted to use generics. I just wanted to program using best practices rather than setting up endless text-based configuration files. I wanted Guise(TM). So I wrote it.
    Also, would you consider joining the JCP expert group
    working on JSF? The whole point of the JCP is to
    allow people with big ideas like yourself to help
    grow the core platform.On 21 October 2004, I wrote on this forum, "I'm willing (and eager) to join the expert group and put in my effort to help effect these changes in the specification..." http://forum.java.sun.com/thread.jspa?forumID=427&threadID=565052
    I then requested directly to join, and Roger Kitain replied that, "Currently, the group has quite a few members, so I'm not adding any more members unless their background is an exceptionally good fit." On 24 January 2005 I provided extensive coverage of my qualifications to both you and Roger.
    On 17 March 2005 I indicated I was still willing to join, but Roger had already pointed out the catch on 7 February 2005: in order for me to spend my time and provide my expertise to contribute to the advancement of JSF, I must pay Sun $5,000. It wasn't enough that I was offering my services for free---Sun wanted me to pay them to allow me to contribute to bettering JSF.
    I hope this overview answers your question about the shortcomings of JSF. If you have any more questions, I'll be happy to answer them. You may be interested in reading more about the basics of the Guise(TM) framework at http://www.javaguise.com/overview and constrasting the Guise approach to that of JSF.
    Sincerely,
    Garret

  • JSF design view - visual components are shrinking

    Hello,
    I have some strange issue while using Design view for JSF and data binding.
    Once I drop any data control elements into visual component (panel, etc) my visual components are shrinking to such size, that I cannot distinguish any elements within design view. I cannot use design view since then and have to place all elements base on structure panel.
    How to reproduce:
    1. Create new JSF page with wizard and accept defaults.
    2. Drop one of the panels (panel box, panel group layout) into JSF layout
    At this stage my visual elements occupy 100% of design view screen and represent anticipated outcome
    3. Drag and drop one of the data control elements (data control panel) into created panels on JSF and create table or form
    Immediately after it visual panel where data control was dropped shrinks to approximately 1/4 of the screen and I cannot see neither available space nor created table for my data components.
    I figured out, that if I remove created by wizard default <af:messages> tag from the top of my JSF, then design view representation fixes. Not sure if I should remove <af:messages> from all my pages.
    Above all looks to me as and bug.
    Environment:
    -Jdeveloper 11g
    -Windows Vista 64b
    -Not bundled JDK 6

    Hi Shay,
    Thank you for response.
    1. I tried to play with screen size without result
    2. I checked your video post, but this does not resolve my issue
    3. This issue occures with all JSF pages and can be reproduced even when following official Oracle step by step tutorials.
    4. I figured out, that removing <af:messages> tag resolves the issue ?! It seems this tag is added by default during drag and drop binding.
    5. On this link http://drop.io/jdev_001 you can see how design view is changes with and without <af:messages> tag
    6. Below is code example from one of the tutorials, that leads to shrinking as well:
    7. Once app is deployed and running page get normal view in IE as expected, so it seems to me, it is issue with Jdev design view, probably influenced by my environment, if nobody reported it before.
    Thank you for your help.
    ===========================================================================
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelStretchLayout id="psl1">
    <f:facet name="center">
    <!-- id="af_one_column_stretched" -->
    <af:decorativeBox theme="dark" id="db1">
    <f:facet name="center">
    <af:decorativeBox theme="medium" id="db2">
    <f:facet name="center">
    <af:panelFormLayout id="pfl1">
    <af:inputText value="#{bindings.p_name.inputValue}" label="#{bindings.p_name.hints.label}"
    required="#{bindings.p_name.hints.mandatory}" columns="#{bindings.p_name.hints.displayWidth}"
    maximumLength="#{bindings.p_name.hints.precision}" shortDesc="#{bindings.p_name.hints.tooltip}" id="it1">
    <f:validator binding="#{bindings.p_name.validator}"/>
    </af:inputText>
    <af:commandButton actionListener="#{bindings.getEmployeesFindByName.execute}" text="getEmployeesFindByName"
    disabled="#{!bindings.getEmployeesFindByName.enabled}" id="cb1"/>
    <af:panelFormLayout id="pfl2">
    <af:inputText value="#{bindings.commissionPct.inputValue}" label="#{bindings.commissionPct.hints.label}"
    required="#{bindings.commissionPct.hints.mandatory}" columns="#{bindings.commissionPct.hints.displayWidth}"
    maximumLength="#{bindings.commissionPct.hints.precision}" shortDesc="#{bindings.commissionPct.hints.tooltip}"
    id="it4">
    <f:validator binding="#{bindings.commissionPct.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.commissionPct.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.email.inputValue}" label="#{bindings.email.hints.label}"
    required="#{bindings.email.hints.mandatory}" columns="#{bindings.email.hints.displayWidth}"
    maximumLength="#{bindings.email.hints.precision}" shortDesc="#{bindings.email.hints.tooltip}" id="it7">
    <f:validator binding="#{bindings.email.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.employeeId.inputValue}" label="#{bindings.employeeId.hints.label}"
    required="#{bindings.employeeId.hints.mandatory}" columns="#{bindings.employeeId.hints.displayWidth}"
    maximumLength="#{bindings.employeeId.hints.precision}" shortDesc="#{bindings.employeeId.hints.tooltip}"
    id="it6">
    <f:validator binding="#{bindings.employeeId.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.employeeId.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.firstName.inputValue}" label="#{bindings.firstName.hints.label}"
    required="#{bindings.firstName.hints.mandatory}" columns="#{bindings.firstName.hints.displayWidth}"
    maximumLength="#{bindings.firstName.hints.precision}" shortDesc="#{bindings.firstName.hints.tooltip}" id="it3">
    <f:validator binding="#{bindings.firstName.validator}"/>
    </af:inputText>
    <af:inputDate value="#{bindings.hireDate.inputValue}" label="#{bindings.hireDate.hints.label}"
    required="#{bindings.hireDate.hints.mandatory}" shortDesc="#{bindings.hireDate.hints.tooltip}" id="id1">
    <f:validator binding="#{bindings.hireDate.validator}"/>
    <af:convertDateTime pattern="#{bindings.hireDate.format}"/>
    </af:inputDate>
    <af:inputText value="#{bindings.jobId.inputValue}" label="#{bindings.jobId.hints.label}"
    required="#{bindings.jobId.hints.mandatory}" columns="#{bindings.jobId.hints.displayWidth}"
    maximumLength="#{bindings.jobId.hints.precision}" shortDesc="#{bindings.jobId.hints.tooltip}" id="it2">
    <f:validator binding="#{bindings.jobId.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.lastName.inputValue}" label="#{bindings.lastName.hints.label}"
    required="#{bindings.lastName.hints.mandatory}" columns="#{bindings.lastName.hints.displayWidth}"
    maximumLength="#{bindings.lastName.hints.precision}" shortDesc="#{bindings.lastName.hints.tooltip}" id="it8">
    <f:validator binding="#{bindings.lastName.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.phoneNumber.inputValue}" label="#{bindings.phoneNumber.hints.label}"
    required="#{bindings.phoneNumber.hints.mandatory}" columns="#{bindings.phoneNumber.hints.displayWidth}"
    maximumLength="#{bindings.phoneNumber.hints.precision}" shortDesc="#{bindings.phoneNumber.hints.tooltip}"
    id="it9">
    <f:validator binding="#{bindings.phoneNumber.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.salary.inputValue}" label="#{bindings.salary.hints.label}"
    required="#{bindings.salary.hints.mandatory}" columns="#{bindings.salary.hints.displayWidth}"
    maximumLength="#{bindings.salary.hints.precision}" shortDesc="#{bindings.salary.hints.tooltip}" id="it5">
    <f:validator binding="#{bindings.salary.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.salary.format}"/>
    </af:inputText>
    <f:facet name="footer">
    <af:panelGroupLayout layout="vertical" id="pgl1">
    <af:panelGroupLayout layout="horizontal" id="pgl2">
    <af:commandButton actionListener="#{bindings.First.execute}" text="First" disabled="#{!bindings.First.enabled}"
    partialSubmit="true" id="cb2"/>
    <af:commandButton actionListener="#{bindings.Previous.execute}" text="Previous" disabled="#{!bindings.Previous.enabled}"
    partialSubmit="true" id="cb3"/>
    <af:commandButton actionListener="#{bindings.Next.execute}" text="Next" disabled="#{!bindings.Next.enabled}"
    partialSubmit="true" id="cb4"/>
    <af:commandButton actionListener="#{bindings.Last.execute}" text="Last" disabled="#{!bindings.Last.enabled}"
    partialSubmit="true" id="cb6"/>
    </af:panelGroupLayout>
    <af:commandButton text="Save" id="cb5" actionListener="#{bindings.mergeDepartments.execute}"
    disabled="#{!bindings.mergeDepartments.enabled}" action="browse"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:panelFormLayout>
    </af:panelFormLayout>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Edited by: user555411 on May 2, 2010 2:08 PM

  • Can I use grid layout in JSF visual page designer ?

    Hello dears...
    I am using Jdeveloper 11 g and 10 g .
    When I tried to use JSF visual editor (from the component palette), and when I drag any control to the page I found that the control go to the top left of the page
    and I even can not move the control to another place in the page by the mouse.
    the JSF visual designer seems to use flow layout for the page . (the same as using flow layout in the swing applications).
    The question is Can I change the page layout to be grid layout instead of flow layout ?????? (to be able to move any control to anywhere in the page.)
    Note that in netbeans 6.1 , when u design JSF page , you have 2 options for the page layout, grid layout and flow layout and u can choose as u like.
    Is this feature found in jdeveloper 11 ?????
    if not , Can anybody tell me any workaround to design JSF pages without using flow layout ????
    Thanks in advance
    Samy
    Edited by: user10653280 on Nov 29, 2008 1:30 PM

    We don't provide absolute positioning for JSF application - this is a bad practice since it fills your JSF page with CSS code and create applications that are not portable between different screen/monitor resolutions - so we use flow layout instead and provide a much richer set of layout components.
    See info here:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_orgpage.htm#CACCBCCI

  • Problem in JSF action mapping for ZOHOwrter

    Hello Every one,
    I am struggling with a problem by using zohowriter in JSF Frame work, my problem is..
    I have developed an application to open and edit a Document which resides in server and save it in server in another path, for this purpose we are using ZohoWriter. For this application the Struts frame work is working fine.
    I have designed xhtml page by using struts framework as bellow,
    <body>
    <form method="POST" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor" target="_self">
    <input type="hidden" name="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc">
    <input type="hidden" name="saveurl" value="http://localhost:8080/Struts/zoho.do">
    <input type="hidden" name="filename" value="mydocument.doc">
    <input type="hidden" name="id" value="12345678">
    <input type="hidden" name="format" value="doc">
    <input type="hidden" name="persistence" value="true">
    <input type="submit" value="Edit" class="divbutton" name="submit">
    </form>
    By using above code that editor is calling the "saveurl" attribute value while saving the document, that is automatically executing the Action class and saving the Document in specified server path.
    But,
    In my application we are following JSF framework,
    In my application I have written the xhtml page like,
    <form id="myform" method="post" enctype="multipart/form-data" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor">
         <h:commandButton value="Edit" />
         <h:inputHidden id="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc" />
         <h:inputHidden id="filename" value="TestPlan.doc" />
         <h:inputHidden id="id" value="12345678" />
         <h:inputHidden id="saveurl" value="http://customers.info-sun.com/itrack/zoho.fileDownload" />
         <h:inputHidden id="format" value="doc" />
    </form>
    in the page designing if I use <h:form> this tag is not containing action attribute , so I am giving by command button but it is not working.
    So, I continued with html form.
    also, if I specify the "saveurl" attribute mapped with backing been , it is executing in page load only , So My actual intention means after editing it needs to call but it is not happening, while loading this method is calling so other problems are raising.
    Can any one please guide me that, what is my mistake and how to over come.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 9, 2009 7:37 AM

    Hi,
    I got solution for the above problem.
    I am calling a servlet instead of calling jsf flow, I got that, the zohowriter calling only lifecycle method for saveurl attribute.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 12, 2009 6:32 AM

Maybe you are looking for