Accessing bean properties in value attrib of jsf tags

I am new to Alfresco and an example upon which i am working uses the following and similar code in a jsp many times. I knw it is calling getName() of DocumentDeatilsBean class but I can not figure out where is it actually configured .. I hope you understand what I am saying
<h:outputText value="#{DocumentDetailsBean.name}" />

In the faces-config.xml there will be a managed-bean section that associates that name with a class and a scope.

Similar Messages

  • Programatic Value/MethodBindings with JSF tags

    I read thread http://forum.java.sun.com/thread.jsp?forum=427&thread=526026 "Using JSP scriplets in the JSF tags". The following was suggested but not recomended in order to use JSF Tag EL with a programatically set value.
    <%
    String myString="MyLabel";
    request.setAttribute("myString", myString);
    %>
    <h:view>
    <h:outputText id="myID" value="#{myString}" />
    </h:view>
    Is it possible to set up ValueBinding's and MethodBindings in a similar way or would it be better to dump the JSF tags and use JSF altogether programatically. Below is an example that seems like it should work but the result is the ValueBinding.toString() ends up being the value.
    thanks in advance;
    <%
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    ValueBinding vb= app.createValueBinding("#{MyBean.member}");
    request.setAttribute("vb", vb);
    %>
    <h:inputText id="myid" value="#{vb}"/>

    --right ValueBinding.getValue() takes a FacesContext, which you definately would not want to pass as and arg in El, even if you could I would think. 
    To answer your question, we are generating several software layers based on an MDA approach. We reverse engineer the database schema into XML then use that "Platform Independent Model" to generate a JDO model and set of persistence-capable Java classes, and now a Faces Bean model and Bean classes. We also have a set of constants files which have all the entity and property names to be used in the web layer.
    Since the database model is huge, and changes alot (government project), hard-coding EL expressions in a thousand places is a very bad idea given the code-generation/reverse-engineering approach.
    We want 100% compile-time checking for all persistent-access properties and the Faces programatic approach to Value/Method bindings gets us there, if it will somehow work.
    --any other ideas would be greatly appreciated.
    --cheers; Scott

  • Accessing bean properties in a jsp

    Hi,
    I am trying to access a bean in my jsp page like this,
    <c:out value="${clientSession.customerName}"/>
    I validate and then set the bean in my action class, I am using struts 1.1,
    package com.neo.five.ereports;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionForm;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.Cookie;
    import javax.servlet.http.HttpSession;
    import com.neo.five.cookies.SessionCookieValidator;
    import com.neo.five.beans.CustomerSessionBean;
    public final class EreportAction extends Action{
         public ActionForward execute(ActionMapping mapping,
                                            ActionForm form,
                                            HttpServletRequest request,
                                            HttpServletResponse response){
              //get the session object
              HttpSession session = request.getSession(false);
              //validate the session cookie if session object dows not exist
              Cookie[] cookies = request.getCookies();
              SessionCookieValidator scv = new SessionCookieValidator(cookies);
              scv.checkCookie();
              //forward to appropriate destination
              //if there is a cookie continue
              if(scv.hasSessionCookie()){
                   //check for session object
                   if (session != null) {
                        //if session does not exist put bean into session that holds the cookie
                        //values
                        if(session.getAttribute("cookieSession")==null){
                             CustomerSessionBean sb = new CustomerSessionBean(scv.getCustomerid(),scv.getCustomerName(),scv.getCfid(),scv.getCftoken());
                             session.setAttribute("cookieSession", sb);
                             request.setAttribute("clientSession",sb);
                        return (mapping.findForward("success"));
                   }else{
                        return (mapping.findForward("failure"));
              }else{
                   return (mapping.findForward("failure"));
    }this is my SessionBean
    package com.neo.five.beans;
    public class CustomerSessionBean {
         private int customerid;
         private String customerName;
         private int cfid;
         private int cftoken;
         public CustomerSessionBean(int customerid,String customerName,int cfid,int cftoken){
              this.customerid=customerid;
              this.customerName=customerName;
              this.cfid=cfid;
              this.cftoken=cftoken;
         public int getCustomerid(){
              return customerid;
         private String getCustomerName(){
              return customerName;
         private int getCfid(){
              return cfid;
         private int getCftoken(){
              return cftoken;
    }however I am getting this error,
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: An error occurred while evaluating custom action attribute "value" with value "${clientSession.customerName}": Unable to find a value for "customerName" in object of class "com.neo.five.beans.CustomerSessionBean" using operator "." (null)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    javax.servlet.ServletException: An error occurred while evaluating custom action attribute "value" with value "${clientSession.customerName}": Unable to find a value for "customerName" in object of class "com.neo.five.beans.CustomerSessionBean" using operator "." (null)
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
         at org.apache.jsp.eReportDeskTopRoot_jsp._jspService(eReportDeskTopRoot_jsp.java:145)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.30
    thanks for any help.

    how?.... mmmm ... did ... (head scratch) ...I miss that.
    Thanks a million for spotting that, I really did appreciate that.
    jp.

  • How to access a backingbean value without a JSF tag?

    Hi,
    I have the following problem:
    As I have my layout defined in CSS, I have a menu build up on an unordered list.
    the different menu entries have their own li with special formating.
    So my plain HTML design looks like this
    <ul>
    <li id="first">First Entry</li>
    <li id="second">Second Entry</li>
    <li id="third">Third entry</li>
    <ul>The first, second and third value of the id attribute should come out of my backing bean.
    But if I try to put a
    <li id="<h:outputText value="Welcome to the GDE Engine Framework." />">Here</li>just inside te id="..." I get an exception
    org.apache.jasper.JasperException: javax.faces.FacesException: org.xml.sax.SAXParseException: The value of attribute "id" associated with an element type "null" must not contain the '<' character.If I think back to JSP pages, there was an +<%=variable %>+ option. Is there anything similar in JSF or how would I solve the upper problem?
    Hopefully someone of you has an idea
    Thanks in advance
    John
    Edited by: jbegham on Nov 14, 2008 10:34 PM

    Hi,
    thanks for the hint regarding the Tomahawk components. There is a helpful one besides the t:dataTable called t:panelNavigation2 which has an attribute layout. If it's value is set to list, the output is rendered as a HTML unordered list.
    Does exaclty what I needs.
    Cheers
    John

  • Accessing Bean Properties

    If a bean has a property accessor like:
    public int getID();
    , it can be accessed using the action:
    <jsp:getProperty name="Bean" property="id"/>.
    What happens if the bean accessor takes a parameter? e.g:
    public int getID(int toGet);
    How do you use the action property accessor to specify the parameter?

    From : http://java.sun.com/products/jsp/tags/11/syntaxref1111.html#8820
    "You cannot use <jsp:getProperty> to retrieve the values of an indexed property"
    An ndexed property is one that requires a parameter in the get method.
    So your only real option is to create a setter method for the parameter, then create a no-arg get method:
      private int _toGet = -1;
      public void setIDToGet(int toGet) { _toGet = toGet; }
      public int getID()
        if (_toGet == -1) throw new IllegalStateException ("The ID to get must be set before you can get the ID");
        int id = //get the id based on _toGet;
        _toGet = -1; //reset _toGet so we need to set it again later ...
        return id;
      }

  • How to access javascript variable's value in a jsp tag?

    Is there any way to access the value of a javascript variable in jsp?

    Hi
    by the way your question is ambigous, i understand the question to some extent here i there is a sample code which may be help full to you. As this problem is faced by me when i was developing some dynamic pages in my company.
    <%@ page language="java" %>
    <html>
    <head>
    <script language="JavaScript">
    var i = 10;
    var k = 20;
    </script>
    </head>
    <%
         String Jspi = "";
         Jspi = ("<script>document.write(i);</script>");
         out.println(Jspi);
         Jspi = ("<script>document.write(k);</script>");
         out.println(Jspi);
    %>
    </body>
    </html>
    This will help u out.
    Cheers
    Rambee

  • How we can use jsf tags in included jsp enclosed in subview tags

    Hello everybody,
    I am developing web app by using jsf. I am including a jsp page "header.jsp" into another jsp page "main.jsp". The header.jsp page is enclosed in jsf subview tag on main.jsp page. The header.jsp contains some static html code and some jsf tags like "outputText". When i added tag library url in header.jsp then my app was not even not initiating and i was getting following exception
    ERROR [UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
    16:22:16,890 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
    at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:929)
    at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
    ....Now i removed jsf tag library url from included jsp "header.jsp" so now my app is running but only static html data is being displayed but the value in the jsf tag "outputText" is not being printed in the browser
    kindly help me. i would be very thankful....

    Your question has nothing to do with Sun Java System Directory Server.
    Please use the right forum(s).
    Thanks

  • Accessing entity class field values in a visual JSF page

    There is a convenient way to access a session values into a JSF visual page using the following:
    String mySessionValue = (String) getValue("#{sessionScope.name}");Like the same, are there any ways to access entity class field values into a visual JSF page? Are there any concepts similar to "entityClassDataProvider" that can be linked to a table component in a visual JSF page?
    Thank you.

    My question is about (Netbeans visual pack) Java Persistence API and how to display the information from an entity class to a JSF page. But the above mentioned tutorial is about the ordinary visual table presentation.
    Thank you.

  • Accessing add() methods through bean properties ?!

    I hope this question is trivial...
    Is there a defined way of using add(*) methods through bean properties ?
    Seems a little odd that Swing components can't be added to a container in a simple "bean-like" way....is there a set*(*) method I've missed ? I'm aware of the getComponents() method on Container...but there's no setComponents(Component []) method.
    Thanks,
    Michael.

    Thank you for the repsonse....but..
    Wouldn't that mean that I'd have to sub-class all the Components I wanted to use....just to add the set*(*) method....isn't there a tidier way ?
    I really find this strange...(I can think of many examples where accessing the add*(*) methods through introspection (possibly by providing set*(*) methods) would be extremely useful....but, staying in a Swing context....)
    If you wanted to create an application that can load, edit and save GUI forms (as many already have). Having all Swing components stick to the javaBeans spec. is very useful. The application can use introspection to grab all the properties of a component, without having any hard-coded logic on dealing with specific classes. Users can then provide their own extensions to the components palette, and by sticking to the javaBeans convention, have the GUI editor expose those properties.
    But....to compose components together (a fundamental concept) the editor must be provided with "hard-coded" logic that knows how to deal specifically with Components (in that they have an add(*) method).
    This must also be a problem with the XMLDecoder class ?!
    When encoding a Swing component, the XMLEncoder can use all the get*() methods (including getComponents()) to persist the Container, its properties, and any sub-components....fine.
    But, when decoding this information, all the properties can be set through the usual bean mechanism (using the corresponding setPropertyName(*) method) except the sub-components....there is no setComponents(*) method.
    How does the XMLDecoder get around this problem ?
    Does it "know" that when it gets to the "components" property of a Swing component, it must call the add(*) method instead...?
    Thanks,
    Michael

  • CRM 2015 - Access product properties values

    In CRM 2015, product catalogs were introduced with properties that were user defined.  I need to access the properties of each product to include them in a workflow. Does anyone know how this can be achieved?

    Are you are trying to send the attributes of the products on an email?
    This is being captured in a new entity called "Property" where these attributes are stored. Unfortunately you will not be able to write a system workflow on this entity. You may have to handle this by writing a code
    to achieve this.
    Hope this helps!
    Regards, Abhishek Bakshi If you find this post helpful then please Vote as Helpful and Mark As Answer. Check my blog on https://mydynamicscrmblog.wordpress.com/

  • Clearing up a backing bean's property values.

    Hi All
    I saw a few similar posts from the past on this forum similar to my issue but couldnt make much sense of them. Therefore appologies for any repetition :)
    I have search jsp/jsf page. And have one session scope backing bean associated with it. There is a cancel/Back button on the jsp page that takes the current user back to the previous page.
    The problem is that if the user entered some search criteria in the UI components that criteria is retained in my backing bean when the user revists the page. I want my bean's properties to be cleared up once the user leaves the page.
    I would prefer not to set the scope of my backing bean to request.
    One solution i can think of is to set all the properties to null before leaving the page. (I have not tried it yet as I am actually posting from home after coming back from work :) )
    Could you guys advise any more elegant solutions that could possibly solve this issue?
    many thanks

    Set the beans propertie values to null in the constructor [If it is in pagecode]
    and in the jsp use binding
    Like for example:in the constructor of the pagecode
    public Some(){
    if((getFacesContext().getExternalContext().getRequestParameterMap().isEmpty()) || (getFacesContext().getExternalContext().getRequestParameterMap().containsKey("parkPlanFrm:prePlanName"))){
    ValueBinding vb = getFacesContext().getApplication().createValueBinding("#{bean}");
    Bean pcBean = new Bean()
    pcBean = (Bean)vb.getValue(getFacesContext());
    pcBean.getParkPlanCountyMenu().setSubmittedValue("select");
    pcBean.getParkPlanCountyMenu().setValue(null);
    vb.setValue(getFacesContext(), pcBean);               
    IN THE JSP:
    <h:inputText id="parkPlanPpn" styleClass="inputText" maxlength="15" size="15"
    value="#{bean.prePlanNumber}" binding="#{bean.parkPlanPpn}" size="15">
    </h:inputText>
    Here *value="#{bean.prePlanNumber}"* is from the Managed Bean
    *binding="#{bean.parkPlanPpn}"* is from PageCode
    Ravi

  • Slow performance during Apply Request Values Phase of JSF lifecycle

    Dear all,
    I found that my application is sucked at the Apply Request Values Phase of JSF lifecycle when I submit the page. (Totally spend 1 min to pass this phase)
    In the application, there is around 300 input fields in the page. Who know how can I ehance the performace?
    Thanks.

    Thanks a lot for your help. Maybe I explain more about my current structure
    I need to develop a input form for course instructor to input students' assignment / examination result (max 9 assignments and 1 examination).
    so that I have below coding:
    *1. bean to store marks of a student*
    public class Mark {
    private String studentID = "";
    private String mark1 = "";
    private String mark9 = "";
    private String markExam = "";
    //getter & setter of above properties
    public void setMark1(String mark1) {
    this.mark1 = mark1;
    public String getMark1() {
    return this.mark1;
    *2. backing bean*
    public class markHandler {
    ArrayList<Mark> marks = new ArrayList<Mark>();
    //getter & setter of above property
    //method to retrieve list of student (this will be the action before go in mark input page)
    public void getStudentList() {
    //get student list from database
    for(int i = 0 ; i < studentCount; i++){
    //initial mark of student
    Mark mark = new Mark();
    mark.setStudentID(studentID);
    mark.setMark1("");
    mark.setMarkExam("");
    //put into arraylist
    marks.add(mark);
    *3. mark input page*
    <html>
    <h:dataTable value="#{markHandler.marks}" var="e">
    <column>
    <h:output value="#{e.studentID}" />
    </column>
    <column>
    <h:input id="mark1" value="#{e.mark1}" />
    </column>
    <column>
    <h:input id="mark1" value="#{e.markExam}" />
    </column>
    </h:dataTable>
    <h:commandButton action="#{markHandler.save} />
    </html>
    When I submit the page, It seems that there is a long time spent at the input field of datatable at Apply Request Values Phase. (I use Phase Listeners to test the time difference before & after phase)
    Pls help. Thanks.
    Edited by: Daniel_problem on Aug 15, 2008 10:34 AM
    Edited by: Daniel_problem on Aug 15, 2008 10:36 AM

  • How to update bean properties when using an immediate link

    Hello,
    I have a page with a find link next to an input text field. The input text field requires a valid code to be entered. If the user doesn't know the code they need to press the find link to go to a search page and select the code. The input text code field needs to have a value entered so it has its required attribute set because the validator I have and attached to the input text field does not get called unless something is entered in the field. If I don't set the link to immediate the required constraint prevents the search page from being invoked but if I do set it to immediate the values typed on the page are not updated to the bean properties they are bound to.
    I have read many posts but I fail to see a way to resolve this. The update model phase is apparently skipped because of the immediate attribute and so the values typed in by the user are lost.
    Please help.
    Thanks,
    Randall

    A UIInput holds the submitted value.
    When updating models it is cleared to null but when some error occurs it keeps to hold the submitted value.
    The TextRenderer uses the submitted value if the value is null.
    Therefore, you can see the submitted value is redrawn when some error occurs.
    Unfortunately, this mechanizm does not work beyond requests
    because the default application action listener always create a new viewroot based on the navigation rules.
    An general solution of your problem is not so easy.
    I think it may be to customize the action listener or the lifecycle.
    A temporal solution may be that the link action copys the submitted value to the managed-beans.

  • How can I access the properties of Microsoft files (excel, ppt, and word)

    Hi,
    How can I access the properties of common Microsoft file formats (Excel, Word, and Powerpoint) from a Java program. You can access/modify the properties of each document type using File->Properties in each MS application. The properties are essentially name/value pairs.
    Basically, I need to write a java program that scans a directory and accesses the properties in each of the MS files in the directory.
    thanks,
    -john

    By api. That is only way to establish a contract with the MS programs you want to interface with, unless you write an api yourself! I've used POI and it was an awesome way to use Excel in java. I created an excel spreadsheet from the results of a sql query from a batch program and then it was automatically emailed using javamail to my client. I had a lot of VBA experience with Excel, Word, and Outlook and it didn't take me long to get used to using Jakarta-POI.
    Now I see there is Jakarta-POI-HWPF which works with MS Word documents. Go to: http://jakarta.apache.org/poi/

  • How to access custom properties in EJB

    Hello,
    I want to supply some properties (20-30) for my EJB application.
    In a non enterprise application I would put these properties into a xml file, read it at startup time by a singleton.
    This singleton holds the read information in static variables and provides them to all other classes.
    I read that with EJB static variables (and so the singleton) are forbidden.
    But what is the best way to provide the properties.
    Should they be defined in an own xml file or better put into an existing one (and which should this be)?
    And if this is done, how can I access these properties?
    I searched at goolge and in several forums, but I don't got a suitable answer.
    I hope you can help me.
    Thanks

    The Java EE spec defines simple name/value pairs for Strings and primitive values called env entries.
    You define them in ejb-jar.xml in the same place as ejb-refs and resource-refs. You can then look
    them up or inject them into your code. Here's an example :
    <env-entry>
    <env-entry-name>config1</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>foo</env-entry-value>
    </env-entry>
    In the code :
    @Resource(name="config1)
    private String c1;
    or
    String c1 = (String) new InitialContext().lookup("java:comp/env/config1");
    or
    @Resource
    private SessionContext sessionCtx;
    String c1 = (String) sessionCtx.lookup("config1");

Maybe you are looking for

  • Publish

    hi! I always have this problem when I try to publish an animated gif. As my clients don´t want swf to send by mail because they say not everyone has the plugin, I have to do a gif. But of course it has a less possibilities: it´s a bigger file, less q

  • I can't send Messages to certain people, but I can reply to their Messages

    Hello, I have an unlocked AT&T iPhone 4, currently using it with Telenor in Sweden. Everything works fine except for the Messages application. When I try to send a message to my Swedish contacts, sometimes they receive it and other times they don't.

  • Cannot create class in system package while Using Sprite class

    Hi i developed a game using Sprite class & imported javax.microedition.lcdui.game.*; package. But when i tried to build this project it gave me "Cannot create class in system package" error. Worst thing is that now again if i build, then it displays

  • 4-system landscape

    Hi, We have a scenario were we might need to have 4-system landscape, need advise: We currently have 3-system landscape DEV/QAS/PRD (ERP 6.0/Linux/Oracle). There is a new major develpemnt project comming our way and need to know how to plan our syste

  • Help: unable to run K7T266Pro2 at FSB133

    My specs are: Athlon XP 1600 Volcano 7 cooler MSI K7T266 Pro2 256Mb 2100 DDR Maxtor 40G Lite On 24x burner 32Mb nVidia TNT When I try to set the fsb to 133Mh in bios i cannot extract any archives without the software telling me the extracted files ar