Concatenation in JSF expressions (EL)

Hi, does anyone know if something like is possible ? (problem is that I would like different texts for different rows in a datatable using a message bundle)
<h:outputText value="'page1' + msg[somevariable] + 'extra text'"></h:outputText>
Appreciate some help.
Thanks

You can't concat values in [ ].
I use a bean do do the concatenation :
<h:outputText value="#{lang[concat['mpr.canton.,#offer.canton']]}"/>
Source :
public class ConcatenationBean extends HashMap
    // log4j static Logger for this class
    private static final Logger logger = Logger.getLogger(ConcatenationBean.class);
    public ConcatenationBean()
        super();
     * Concat the string separated by a comma Evaluate JSF EL expression if
     * token begin by # or $
     * @param inObject :
     *            is the list of string to concat separated by a comma. return a
     *            String exemple : <h:outputText
     *            value="#{lang[concat['mpr.canton.,#offer.canton']]}"/>
    public Object get(Object inObject)
        StringBuffer resultBuffer = new StringBuffer();
        try
            String inToken = (String) inObject;
            StringTokenizer tok = new StringTokenizer((String) inToken, ",", false);
            while (tok.hasMoreTokens())
                String token = tok.nextToken().trim();
                if (logger.isDebugEnabled())
                    logger.debug("inToken=" + token);
                if (token.startsWith("#{"))
                    Object tokenEvaluated = FacesHelper.getElValue(token);
//                    if (tokenEvaluated instanceof String)
                        resultBuffer.append(String.valueOf(tokenEvaluated));
//                    else
//                        logger.error("#{...} EL expression is not a String : " + token);
                else if (token.startsWith("${"))
                    token = token.substring(2, token.length() - 1);
                    if (logger.isDebugEnabled())
                        logger.debug("token $ =" + token);
                    Object tokenEvaluated = FacesHelper.getElValue(FacesHelper.getJsfEl(token));
//                    if (tokenEvaluated instanceof String)
                        resultBuffer.append(String.valueOf(tokenEvaluated));
//                    else
//                        logger.error("${...} EL expression is not a String : " + token);
                else if (token.startsWith("#"))
                    token = token.substring(1);
                    Object tokenEvaluated = FacesHelper.getElValue(FacesHelper.getJsfEl(token));
//                    if (tokenEvaluated instanceof String)
                        resultBuffer.append(String.valueOf(tokenEvaluated));
//                    else
//                        logger.error("#... expression is not a String : " + token);
                else
                    resultBuffer.append(token);
        catch (Throwable e)
            logger.error(null, e);
        return resultBuffer.toString();
}I hope it will help you...

Similar Messages

  • How to use Type Casting in JSF Expression Language

    I have an attribute CategoryId in my VO of type oracle.jbo.domain.Number. I am trying to use the expression of Boolean item in JSF as #{row.CategoryId != 4}
    Here is the JSF code:
                          <af:column id="s141NewItem3Col" noWrap="true" width="100"
                                     rowHeader="false">
                            <f:facet name="header">
                              <af:outputLabel value="CAtIDDeq4" showRequired="false"
                                              id="ol18"/>
                            </f:facet>
                            <af:inputText id="s141NewItem3"
                                          value="#{row.CategoryId != 4}"
                                          label="CAtIDDeq4" required="false"
                                          readOnly="#{((pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn']))) or ((!pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn'])))}"></af:inputText>
                          </af:column>I am getting the run time exception as "Can not convert 4 of type class oracle.jbo.domain.Number to class java.lang.Long".
    I am wondering how the row.CategoryId is treated as Long?. PLease advise. Also, will I be able to use type casting expressions in JSF Expression Language?
    Thanks, Pradeep

    use attributeValue
    Try *#{row.bindings.CategoryId.attributeValue != 4}* ?
    Check this thread for details which discusses about the same:
    El expression to disable  or enable
    Thanks,
    Navaneeth

  • Tip : resolve JSF expressions at runtime

    hi
    Sometimes it might be useful to be able to take a look into your application at runtime.
    One way to do this, is to pass JSF expressions into your application and see how they get resolved.
    The simple ExpressionResolver bean and expressionResolver.jspx page below enable you to do this.
    (*) the ExpressionResolver class :
    package view.util;
    import javax.faces.application.Application;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    public class ExpressionResolver
         private String fExpression = null;
         private Object fExpressionResult = null;
         public String resolveButton_action()
              FacesContext vFacesContext = FacesContext.getCurrentInstance();
              Application vApplication = vFacesContext.getApplication();
              try
                   ValueBinding vExpressionVB =
                        vApplication.createValueBinding(getExpression());
                   setExpressionResult("unable to resolve expression : "
                        + getExpression());
                   if (vExpressionVB != null)
                        setExpressionResult(vExpressionVB.getValue(vFacesContext));
              catch (Exception ex)
                   setExpressionResult("error resolving expression : ex = " + ex);
              return null;
         public void setExpression(String expression)
              this.fExpression = expression;
         public String getExpression()
              return fExpression;
         public void setExpressionResult(Object expressionResult)
              this.fExpressionResult = expressionResult;
         public Object getExpressionResult()
              return fExpressionResult;
    }(*) the expressionResolver.jspx page :
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <html>
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
            <title>expressionResolver</title>
          </head>
          <body><h:form>
              <h:panelGrid columns="1">
                <h:outputText value="expression resolver"/>
                <h:panelGrid columns="2" rendered="true">
                  <h:inputTextarea id="expression"
                                   value="#{expressionResolver.expression}"
                                   rows="4" cols="50"/>
                  <h:commandButton value="resolve" id="resolveButton"
                                   action="#{expressionResolver.resolveButton_action}"/>
                </h:panelGrid>
                <h:outputText value="#{expressionResolver.expressionResult}"/>
              </h:panelGrid>
            </h:form></body>
        </html>
      </f:view>
    </jsp:root>(*) the configuration in faces-config.xml :
      <managed-bean>
        <managed-bean-name>expressionResolver</managed-bean-name>
        <managed-bean-class>view.util.ExpressionResolver</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>So if you add these to an application, for example the "Oracle ADF SRDemo Application", you could resolve expressions like these at runtime (or any other expression you can come up with):
    #{data.SRPublicFacade.methodResults}
    #{data.SRPublicFacade.methodResults.SRPublicFacade_dataProvider_findServiceRequests_result}
    #{data.SRPublicFacade.methodResults.SRPublicFacade_dataProvider_findServiceRequests_result[0].problemDescription}
    #{resources['srdemo.version']}
    #{userInfo.userName}
    #{userState.searchFirstTime}All suggestions for improvement are welcome of course.
    One more thing ... a page like this should probably not be part of a production deployment of your application or it should be properly secured.
    regards
    Jan Vervecken

    Jan,
    this looks useful to me, especially if you work in support. Do you have a blog where this tip is mentioned, so we can link to it ?
    Frank

  • Is it possible to access a consant attribute with a JSF expression?

    I have a class with constant attributes like this:
    public static final int CONSTANT_VALUE = 111;
    How do I access them with a JSF expression?
    #{myBean.CONSTANT_VALUE} does not work.
    Do I have to write getters for them? I heared somewhere that its not bossible
    to access them directly.
    Thanks!

    just write a get method of this attribute

  • How do I concatenate strings in JSF expressions (EL)?

    So I want to do something like:
    <h:outputText id="foo" value="msgs['label.' + prop]" />
    "prop" is a variable involved in a loop using a dataTable. It'll have a string value like "firstName" or something. 'msgs' refers to a resource bundle initialized earlier in the JSP.
    The above line doesn't work because in JSF, the plus(+) symbol is only for arithmetic and so, exceptions get thrown.
    How do I do the equivalent of the above? I can rename my resource bundles to not have the 'label.' prefix, but there's got to be a better way.
    Any help one can give would be great. Thanks!
    Jimmy Ho

    I'm not sure I understand. I have no database interactions. The things I'm trying to concatenate to ".label" is just some list of strings I get from a properties files somewhere in my code.
    Ahaaaa, not what I understood...somehow :) sorry
    I can see how I can change each String to some Foobar object where I can do blah.label and blah.value, and make that work, but creating a whole new class seems excessive. Is there another way?
    I dont know if there is straight forward one, just like + with strings, another idea is to open the properties file and read the strings you need and append to the .label...if that makes any reasonable sense

  • JSF expression language question

    Hi, is it possible to write something like this:
    <h:dataTable value="#{myControllerBean.persons}" var="person">
    <h:column>
    <h:outputText value="#{person.#(myControllerBean.selectedItem)}"/>
    <h:column/>
    </h:dataTable>
    where i can dynamicly choose property for person bean.
    myControllerBean.selectedItem is string, and depending on its value i want the column to be person.name or person.age, ....
    I know this can be solved with columns for every case and rendered attribute, but i'm looking for some better solution :)
    Thanks in advance.

    Try this:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <c:set var="tmp" value="#{myControllerBean.selectedItem}"/>
    Now set tmp in outputText as dynamic value:
    <h:dataTable value="#{myControllerBean.persons}" var="person">
    <h:column>
    <h:outputText value="#{person[tmp]}"/>
    <h:column/>
    </h:dataTable>

  • Concatenation in EL expression

    HI ,
    I want to concatenate '%' to one of my attribute's NDValue
    can i do some thing like this
    NDValue=" $ { bindings.getSearchResults_Code + '%' } "
    or is there any other way to do that..
    Thanks ,
    Naveen

    Hi,
    you can't concatenate strings in El. You could use a managed bean to do this for you
    Frank

  • Ugly JSF Code

    Hello,
    I want to delete an entity that is referenced by a GET id attribute. I want to add a button/link in the web page to do this job.
    I did it using the JSF expression language and the h:outputLink referencing to a Servlet:
    <h:dataTable value="#{price_controller.allPrices}" var="current_price">
    <h:column>
    <f:facet name="header"><h:outputText value="Remove"/></f:facet>
    <h:outputLink value="remove_price?price_id=#{current_price.id}&product_id=#{price_controller.productId}">
    Remove
    </h:outputLink>
    </h:dataTable>
    ¿Is there any way to have the logic in a Managed Bean instead of a Servlet?
    It seems that the only way to do that is using the h:commandLink/h:commandButton but I don't know how to send the "#{current_price.id}" information.
    Thanks,
    Pau
    Edited by: Pau_carre on Jan 21, 2010 5:35 AM

    Your JSF:
    <t:dataTable value="#{myBean.records}" id="results"
      var="showRecos" binding="#{myBean.recordsTable}">               
      <t:column width="8%">
        <h:commandButton id="button" action="#{myBean.myAction}"
          image="/images/folder.gif"/>
        <h:outputText id="recordId" value="#{showRecos.recordId}"/>
      </t:column>
      <t:column>
          <h:outputText id="recordData" value="#{showRecos.someData}"/>
      </t:column>
    </t:dataTable>In your Bean:
    //Variables
    private ArrayList<RecordBean> records;
    private UIData recordsTable;
    //Add getters and setters to the above variables
    //Action
    public String myAction(){
      try{
         RecordBean recordBean = (RecordBean) recordsTable.getRowData();
         System.out.println("****Selected Record****");
         System.out.println("Record Id:"+recordBean. recordId);
      }//Followed by catch, finally
    }

  • JSF getting task instance id

    Hi all
    I am new to JSF..We are using jsf with the JBPM JPDL Engine.
    My question is i able to access the process instance id using JSF expression #{processIntance.getId} ..how do I get the task Instance id ..
    I tried #{taskInstance.getId} does not seem to work..
    Also if you point me to any useful documentation in this respect..i would be greatful..thanks in advance..

    Thanks for your reply.. I sorted this out..
    If I need the taskInstance id i need to use it in the task node execution context .It works ok..if used inside the "task-assign" system template..

  • Using EL in JSF

    Hello,
    maybe a stupid question but I asked myself why I can't use the $ symbol when using EL in JSF. Can somebody tell me the difference between using # or $ when writing EL in JSP/JSF
    Thx
    Chris

    Yes, it very depends.
    JSF 1.1 and JSP2.0 have their own EL. They do not understand each other.
    #{} uses only for jsf tag attributes. You cannot able to use it outside (Except with Facelets, but it is not about JSP at all).
    In contrast, ${} cannot be used inside the JSF tag attributes.
    JSF1.2 and JSP2.1 use unified EL. Now, you can use them both everywhere on the page, but the major difference still exists.
    ${} is a immediate EL
    #{} is a deferral EL
    #{} orginizes binding instead of immediate replacement. You can use #{} as an L-Value expression.
    For more information read this article:
    http://today.java.net/pub/a/today/2006/03/07/unified-jsp-jsf-expression-language.html

  • JSF tags + target

    I am developing a web application using JSF ,Spring and Hibernate.
    I have designed a page which has an update button,on click of that a new window will open with fields that are to be updated.
    In this child window there will be one more Update, on clicking this i want this child window to be closed and updated values to be reflected on the parent window.
    Is there a tag in JSF which can take care of this ??
    I would like to know how to go about this.
    Thanking in anticipation
    Ashvini

    Hi Asvin
    Could you please share your JSF Spring Hibernate Integration prototype code as i am sailing in the same boat and have problems integrating this technologies
    Here is the info
    Hi All
    I am using JSF 1.1_01, Spring 1.2.6, Tomcat 5.0.28.
    I am getting following error
    javax.servlet.jsp.JspException: javax.faces.FacesException: javax.faces.el.EvaluationException: Expression Error: Named Object: 'springBean' not found.
    The root cause for the error is "<managed-property>" under <managed-bean> from JSF which references Spring Bean. It is not able to evaluate JSF Expression Language. Then i tried following permutations and combinations
    -> instead of using JSF EL, i hardcoded the property value and it worked
    Any pointers/suggestions will be highly appreciate. I am working on this for more than a week
    Regards
    Bansi

  • 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

  • Problems with JSF 1.1_01 and Spring 1.2.6 Integration :

    Hi All
    I am using JSF 1.1_01, Spring 1.2.6, Tomcat 5.0.28.
    I am getting following error
    javax.servlet.jsp.JspException: javax.faces.FacesException: javax.faces.el.EvaluationException: Expression Error: Named Object: 'springBean' not found.
    The root cause for the error is "<managed-property>" under <managed-bean> from JSF which references Spring Bean. It is not able to evaluate JSF Expression Language. Then i tried following permutations and combinations
    -> instead of using JSF EL, i hardcoded the property value and it worked
    Any pointers/suggestions will be highly appreciate. I am working on this for more than a week
    Regards
    Bansi

    You must have in your web.xml :
         <context-param>
              <param-name>contextConfigLocation</param-name>
              <param-value>
                   /WEB-INF/yourSpringBeanContext.xml,
              </param-value>
         </context-param>
         <listener>
              <listener-class>
                   org.springframework.web.context.ContextLoaderListener
              </listener-class>
         </listener>Give your code to understant what's wrong :
    yourSpringBeanContext.xml, web.xml and faces-config.xml
    regards,

  • Problems with combination of ADF Faces, Tomahawk, Facelets and MyFaces

    Hello,
    I am trying to combine all things named in the Subject and run into several problems:
    1. ADF Render Kit forces the Tomahawk Components to be rendered in a wrong way or stop there functionality.
    Example 1: The clickable parts of the t:dataScroller Tag can not be accessed because an empty a Tag will be rendered after the outputText.
    Example 2: The t:commandSortHeader Tag can be clicked but the table content will not be sorted anymore.
    The given examples works if i remove the default-render-kit-id element from the faces-config.xml
    2. The ad:table Tag runs into an ClassCastException, only when I put a simple example code snipped into my xhtml file.
    Code snipped:
    <af:table>
    <af:column>
    <f:facet name="header">
    <af:outputText value="Firstname"/>
    </f:facet>
    </af:column>
    <af:column>
    <f:facet name="header">
    <h:outputText value="Lastname"/>
    </f:facet>
    </af:column>
    </af:table>
    The stack trace look like this:
    java.lang.ClassCastException at oracle.adfinternal.view.faces.renderkit.core.xhtml.DesktopTableRenderer._renderRegularColumns(DesktopTableRenderer.java:1029)
         at oracle.adfinternal.view.faces.renderkit.core.xhtml.DesktopTableRenderer.renderSingleRow(DesktopTableRenderer.java:109)
         at oracle.adfinternal.view.faces.renderkit.core.xhtml.TableRenderer.encodeAll(TableRenderer.java:229)
         at oracle.adfinternal.view.faces.renderkit.core.xhtml.DesktopTableRenderer.encodeAll(DesktopTableRenderer.java:79)
         at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)
         at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)
         at oracle.adf.view.faces.component.UIXCollection.encodeEnd(UIXCollection.java:438)
         at oracle.adfinternal.view.faces.renderkit.RenderUtils.encodeRecursive(RenderUtils.java:54)
         at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:232)
         at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeAllChildren(CoreRenderer.java:255)
         at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:65)
         at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:117)
         at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:147)
         at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:60)
         at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)
         at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)
         at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
         at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
         at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:521)
         at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    I followed all steps for the ADF installation and the suggested steps for using ADF with Facelets.
    Used versions:
    - Oracle ADF Faces 10.1.3 Early Access
    - myFaces 1.1.1
    - Facelets 1.1.1
    - oc4j 10.1.2.0.2
    Has somebody try to use these things together, too?
    Thanks,
    Carsten

    Hi,
    Inside our fusion applications(ADF/Webcenter) using combination of JSTL and ADF Faces is good practice or pitfal?
    To suggest a a rule of thumb: Try ADF Faces on-board functionality first before reaching out to JSTL. The difference between JSF in general and JSTL is that the JSTL expressions are evaluated at page compile time wheras JSF expressions are evaluated deferred. This difference may have an impact to PPR refreshes and the data rendering (which in many cases I assume you can fix by setting the ADF Faces component content delivery to immediate instead of deferred). On a training slight I flagged JSTL with a "heads up" alert because of this
    Frank

  • Issue in JSF1.1 with jdk1.4...

    Hi All,
    I am facing a very peculiar issue. I am using JSF 1.1 with j2sdk1.4.2_10 and Tomcat 5.5.7. JSF Expression language is giving me some puzzling errors
    if I say
    value="#{varList.AInfo.BInfo.someName}
    mapped in a datatable tag like this, where varList is the ArrayList we are mapping the table to, Ainfo is a TreeMap inside it, BInfo is a TreeMap inside AInfo, and someName is a property, it complains saying that "error retrieving property someName"....This happens only on j2sdk1.4.2_10, it was working fine (it still works fine) on j2sdk1.4.2_04. I just need to change the JAVA_HOME environment variable, and the problem surfaces.
    I cannot use j2sdk1.4.2_04 because it results in a core dump elsewhere (the reason I upgraded to j2sdk1.4.2_10).
    is this a bug in JSF, or something in j2sdk1.4.2_10 that is causing it to fail?
    Can anyone help me with this?

    Hello,
    J2SE 1.2, 1.3, and 1.4 Desupported. Oracle 11R1 does not support J2SE 1.2, 1.3, and 1.4. The .zip and .jar files that support those versions of J2SE are not included in
    Oracle JDBC 11R1. If you are still using J2SE 1.2, 1.3, or 1.4 you can continue to use Oracle JDBC 10.2.0.1.0 with those versions of Java. 10gR2 is still fully supported for use with those versions
    of Java. If you want to use Oracle JDBC 11R1 you must use J2SE 5.0 or later. Using desuported version might result in errors and inconsistent performance.
    Please see this link for more details
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/111070_readme.html

Maybe you are looking for

  • Mac Mini Purchase Question HDTV

    Hello, I want to buy a mac mini for an entertainment computer. I think the hdmi out will be great. All I want to do is watch movies through my samsung 55" HDTV. I am wondering if the basic model will be enough or should I get a suped up model. If I n

  • Outgoing Payment - Bank transfer method default

    Where / how is the default G/L set on the Bank Transfer tab of the payment means on an outgoing payment?  I want it to default to a new banks G/L account but I can't seem to get it to change. Thanks

  • Why are my browsers suddenly displaying foreign language?

    and how do i fix it. both safari and ff started displaying some content (not all) in foreign characters. for example, going to cnn.com, some article headers are no longerr english. or on wikipedia's english site, most of the content is no longer in e

  • Sharing a Nano

    I want to create a list of songs on my Nano made from all my wifes music. I almost always use my Nano on song shuffle and I don't want to hear her music. Is there a way to lock out a specific list or section off an area in the Nano? Any help is appre

  • DC Build Warning

    Hi, When I build my DC I get the following warning      [Ant] java.lang.reflect.InvocationTargetException        [Ant]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        [Ant]      at sun.reflect.NativeMethodAccessorImpl.invok