How to set bean property in jsf page

Hi,
Hopefully theres an easy solution, but I can't figure it out...
I have a managed bean that spans several jsf pages.
Within each page I want to set a flag that tells the bean which page it is serving (as well as some other params).
How do I set a property of the bean in the page?
I've tried
<jsp:useBean id="filter3" scope="request" class="com.aol.rsistats.ui.FilterBean"/>
<jsp:setProperty name="filter3" property="filterType" value="3"/>
but that doesn't load the page through the normal JSF routine (and I initialise some values of the bean in the faces-config.xml file... so these are not initialiased when the setProperty is called) .
(In general I get some strange behaviour when I mix jsf tags with jsp, or jstl, so I've avoided it as much as possilble)
Is there another way?
Cheers,
Keith

This example works for me (using jsf-1_1_01).
Index.jsf:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page language="java" %>
<%-- jakarta-taglibs-standard-1.0 --%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%--
Note, that with jakarta-taglibs-standard-1.1.1 taglib directive
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
the example NOT works!!!
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head>
<title>MyTitle</title>
</head>
<body>
<f:view>
<%--
Do not delete the following lines! You need to address to WIManager before using c:set.
--%>
<!--
<h:outputText value="#{WIManager != null}"/>
-->
<c:set target="${requestScope.WIManager}" property="bpId" value="bpIdValue"/>
<h:form id="MyWebFormTask" >
<h:commandButton id="ok" action="ok" value="Ok"/>
<h:inputHidden id="bpId" value="#{WIManager.bpId}"/>
</h:form>
</f:view>
</body>
</html>
ok.jsf:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page language="java" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head>
<title>MyTitle</title>
</head>
<body>
<f:view>
WIManager.bpId: {<h:outputText value="#{WIManager.bpId}"/>}<br>
</f:view>
</body>
</html>
In ok.jsf I can see WIManager.bpId property set in Index.jsf.
faces-config.xml:
<managed-bean>
<managed-bean-name>WIManager</managed-bean-name>
<managed-bean-class>my.package.WIManagerBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>bpId</property-name>
<property-class>java.lang.String</property-class>
<value>#{param.wim_bpid}</value>
</managed-property>
</managed-bean>
Resume:
-- use <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
instead of <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-- address to WIManager before using c:set.

Similar Messages

  • How to set Bean property

    I have JSF input <h:inputtext> and JSF Button
    on click i want to set bean property value = user whatever enter in text box how acn i do that?

    well,
    You have to create backing bean with property setter and getter.
    Then:
    <h:inputtext value="#{beanName.propertyName}"/>Now when page is loaded getter is used and when submited setter goes in action
    I would recomend http://www.coreservlets.com/
    Message was edited by:
    m00dy

  • How to use postback property for JSF to reneder a popup only once

    Hi All,
    I'm using java script function to show a JSF page as popup. I have called the javascript function on page load of another JSF page.
    How do i make sure that the popup is getting rendered only once and not everytime the page is getting refreshed .
    Can i use postback property in JSF page for this purpose ?
    Thanks in Advance.

    try postback..
            Boolean postBackValue = (Boolean)resolveExpression("#{adfFacesContext.postback}");
            Boolean defaultBooleanValue = new Boolean("false");
            if (postBackValue.equals(defaultBooleanValue)) {
      public static Object resolveExpression(String expression) {
        FacesContext ctx = FacesContext.getCurrentInstance();
        Application app = ctx.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = ctx.getELContext();
        ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
        return valueExp.getValue(elContext);
      }

  • How to set cookie value in one page and retrieve in another page using setA

    How to set cookie value in one page and retrieve in another page using setActionListener?
    I have tried with following code srcpage.jspx->destpage.jspx
    srcpage.jspx
    <af:table value="#{bindings.DepartmentsView1.collectionModel}"
    var="emp" rows="#{bindings.EMPView1.rangeSize}"
    first="#{bindings.EMPView1.rangeStart}"
    emptyText="#{bindings.DepartmentsView1.viewable ? 'No rows yet.' : 'Access Denied.'}">
    <af:column sortProperty="EmployeeName" sortable="false"
    headerText="Cookie Testing">
    <af:commandLink text="#{emp.EmployeeName}" action="success">
    <af:setActionListener from="#{emp.EmployeeName}"
    to="#{cookie}"/>
    </af:commandLink>
    </af:column>
    </af:table>
    espage.jspx
    <af:outputText value="Test Cookie Value: #{cookie}"/>
    ,Here Test Cookie Value prints the following instead of its original String value
    {JSESSIONID=javax.servlet.http.Cookie@7da288, oracle.uix=javax.servlet.http.Cookie@399f62}
    I have passed employee name "Robert" to cookie in srcpage.jspx,but it prints "JSESSIONID....." instead of "Robert" in destpage.jspx
    Thanks in advance
    Kalee

    Hi,
    "cookie" is a reserved name. If you want to write to a session scope attribute called "cookie" then you have to call #{sessionScope.cookie}. If you want to use EL to set and read from cookies then you will have to use
    #{cookie.cookieName}
    Note that #{cookie} writes to and returns a map
    check this: http://www.informit.com/articles/article.aspx?p=30946&seqNum=7
    Frank

  • How to set unequal columns using master pages in InDesign CS3?

    How to set unequal columns using master pages in InDesign CS3?

    I don't have CS3 anymore but I don't think this has substantially changed in the last few versions of InDesign.
    Choose View > Grids & Guides > uncheck Lock Column Guides. Then drag the column guides to the position you want.

  • How to Set "DateOnly" property in DateTimeControl using Javascript.

    How to Set "DateOnly" property in DateTimeControl using JavaScript.

    Is there any specific reason you want to set it through JavaScript ? You can directly set the DateOnly property in the markup itself.
    <SharePoint:DateTimeControl runat=server id="dtControl" DateOnly="true"></SharePoint:DateTimeControl>
    Please can you elaborate on what exactly is the requirement for setting this through javascript?
    Geetanjali Arora | My blogs |

  • How do I get the bean property to JSP page for use in a Scriplet

    Hi all,
    I am new to JSF and would like to know how can I get the Bean property to a JSP page and then use that property to dynamically display the contents.
    Thank in advance,

    Hi,
    I think the following page will be helpfull.
    http://java.sun.com/developer/technicalArticles/javaserverpages/JSP20/
    Akif

  • How to set updatable property of view object on runtime

    Hello Gurus,
    I am new in adf and using jdev 11.1.2.3.
    I have two view object which has view link and they are based on entity object. In master view i have a column with the name of status. The target is if the value of status is 'active' then i want to allow add rows in detail view and if it is inactive then wants to disable adding or editing in the detail view.
    I don't know how to do this. I don't know how to get the other view object and how to set update able property and where to write code in entity object class or view object class.
    Any advice................
    Thanks in Advance

    There are multiple possible ways to archive this. As the VOs are in a master-detail relationship, you can opt to add a navigation method to the child back to the parent. This method can be accessed via java or groovy to allow the child access to the master row. Once the child has access you can use this to ask the master for it's status and if it's not active disable the edit and update buttons.
    If both master and detail are on the same page in the ui, there is an easier way. Drag the status attribute from the master table onto the page as e.g. inputText. This will create a binding for the attribute which changes if you select a row in the master table. As you don't need to inputtext, switch to the source mode of the page and delete it. This will remove the inputtext put keep the binding. Now you can use hte binding in an EL to set the disable property of other components to true like
    <af:commandButton text="commandButton 1" id="cb1" disabled="#{bindings.masterstatus.inputValue ne 'active'}"/>
    The button will only be active it the binding for masterstatus is active.
    Timo

  • How to set photometricInterpretation property while storing TIFF using JAI?

    I am converting JPG Grey Sale image in to bilevel image and saving in TIFF format with Group IV compression.
    When I view the output TIFF, some applications displaying it properly and some others by inverting the image.
    After a long time, I found that photometricInterpretation property is used to control this property of White_on_Black or Black_on_White in TIFF files.
    In web I have found that, if we use IndexColorModel, then there is no problem. But, I am not using it and I don't know how to set color model of RenderedOp to IndexColorModel. Did anybody know it?
    Is there any other way to set the PHOTOMETRICINTERPRETATION property ?
    Any solution or suggestions are welcome...
    Edited by: baskaraninfo on Nov 20, 2007 7:20 AM

    To view the solution :
    http://www.javaworld.com/javaforums/showflat.php?Cat=2&Number=70133&an=0&page=0#Post70133

  • How-to get attributes from one JSF page redirected to another?

    How do I send information from one JSF page when the navigation rule redirects it to another?
    When JSF navigation does a forward I can use request.setAttribute() in the from-page and then use request.getAttribute() in the to-page, but this doesn't work with <redirect/>.
    Regards,
    Al Malin

    The process scope in ADF Faces solves this. See:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.adffacesguide%7Cdevguide%7CcommunicatingBetweenPages%7Ehtml/

  • How  to Set JMS property and Read JMS property in BPEL using JMS adapter

    Does any one know how to set or read more than one JMS property in BPEL using JMS adapter. My queue server is Oracle JMS server.
    Any help and sample is well appreciated

    Hi Van
    I have noted that only the attribute "type" is missing. It seems that when you create a "string" property, the attribute "type" is droped from the XML. If you use another type (as "integer" or "double") it stays there.
    If you try to read your properties, except for the "type" attribute, you should be successful, as I am. If you need, please tell me your email, I can send you my code.
    Source Code:
    in ASSIGN activity (process which SENDS the JMS message):
    <assign name="TESTES">
    <copy>
         <from expression="'string'"/>
         <to variable="HeaderJms" part="outboundHeader"
         query="/ns5:JMSOutboundHeadersAndProperties/ns5:JMSOutboundProperties/ns5:Property[1]/@type"/>
    </copy>
    <copy>
         <from expression="'name'"/>
         <to variable="HeaderJms" part="outboundHeader"
         query="/ns5:JMSOutboundHeadersAndProperties/ns5:JMSOutboundProperties/ns5:Property[1]/@name"/>
    </copy>
    <copy>
         <from expression="'value1'"/>
         <to variable="HeaderJms" part="outboundHeader"
         query="/ns5:JMSOutboundHeadersAndProperties/ns5:JMSOutboundProperties/ns5:Property[1]/@value"/>
    </copy>
    <bpelx:append>
         <bpelx:from>
         <Property name="" type="" value=""
              xmlns="http://xmlns.oracle.com/pcbpel/adapter/jms/"/>
         </bpelx:from>
         <bpelx:to variable="HeaderJms" part="outboundHeader"
              query="/ns5:JMSOutboundHeadersAndProperties/ns5:JMSOutboundProperties"/>
    </bpelx:append>
    <copy>
         <from expression="'string'"/>
         <to variable="HeaderJms" part="outboundHeader"
         query="/ns5:JMSOutboundHeadersAndProperties/ns5:JMSOutboundProperties/ns5:Property[2]/@type"/>
    </copy>
    <copy>
         <from expression="'name2'"/>
         <to variable="HeaderJms" part="outboundHeader"
         query="/ns5:JMSOutboundHeadersAndProperties/ns5:JMSOutboundProperties/ns5:Property[2]/@name"/>
    </copy>
    <copy>
         <from expression="'value2'"/>
         <to variable="HeaderJms" part="outboundHeader"
         query="/ns5:JMSOutboundHeadersAndProperties/ns5:JMSOutboundProperties/ns5:Property[2]/@value"/>
    </copy>
    </assign>
    in ASSIGN activity (process which READS the JMS message)
    <assign name="Assign_1">
    <copy>
    <from variable="Variable_1" part="inboundHeader"
    query="/ns3:JMSInboundHeadersAndProperties/ns3:JMSInboundProperties/ns3:Property[10]/@name"/>
    <to variable="temp"/>
    </copy>
    <copy>
    <from variable="Variable_1" part="inboundHeader"
    query="/ns3:JMSInboundHeadersAndProperties/ns3:JMSInboundProperties/ns3:Property[10]/@value"/>
    <to variable="temp"/>
    </copy>
    <copy>
    <from variable="Variable_1" part="inboundHeader"
    query="/ns3:JMSInboundHeadersAndProperties/ns3:JMSInboundProperties/ns3:Property[12]/@name"/>
    <to variable="temp"/>
    </copy>
    <copy>
    <from variable="Variable_1" part="inboundHeader"
    query="/ns3:JMSInboundHeadersAndProperties/ns3:JMSInboundProperties/ns3:Property[12]/@value"/>
    <to variable="temp"/>
    </copy>
    </assign>
    Note that I do not try to read the "type" attribute, otherwise it will fail.
    Here is the JMS Header Message received:
    <inboundHeader>
    <JMSInboundHeadersAndProperties xmlns="http://xmlns.oracle.com/pcbpel/adapter/jms/">
    <JMSInboundHeaders>
    <JMSCorrelationID>
    bpel://localhost/pi_lms-c001e/BpelPiAtualizacaoC001E~1.0/3200025-BpInv0-BpSeq1.6-2
    </JMSCorrelationID>
    <JMSDeliveryMode>2</JMSDeliveryMode>
    <JMSExpiration>0</JMSExpiration>
    <JMSMessageID>ID:467DFA1FA1ED459EBF37F51F596C3F12</JMSMessageID>
    <JMSPriority>4</JMSPriority>
    <JMSRedelivered>false</JMSRedelivered>
    <JMSType>com.mercurio.lms.integration.c001eip.c001EIntegrationPoint</JMSType>
    <JMSTimestamp>1201552046253</JMSTimestamp>
    </JMSInboundHeaders>
    - <JMSInboundProperties>
    <Property name="JMSXDeliveryCount" type="integer" value="1"/>
    <Property name="JMSXRecvTimestamp" type="long" value="1201552046698"/>
    <Property name="JMSXUserID" value="lms_dev_int_v1_user"/>
    <Property name="JMS_OracleDeliveryMode" value="2"/>
    <Property name="JMS_OracleTimestamp" type="long" value="1201552046253"/>
    <Property name="JMS_OracleDelay" type="long" value="0"/>
    <Property name="JMSXState" type="integer" value="0"/>
    <Property name="IAS_VERSION" value="10.1.3"/>
    <Property name="JMS_OracleDeliveryMode" value="2"/>
    <Property name="name" value="value1"/> ("type" attribute was droped!!!)
    <Property name="JMS_OracleTimestamp" type="long" value="1201552046253"/>
    <Property name="name2" value="value2"/> ("type" attribute was droped!!!)
    </JMSInboundProperties>
    </JMSInboundHeadersAndProperties>
    </inboundHeader>
    Regards
    Marcelo

  • How to include taglib in a JSF page?

    Hi,
    How can I include a taglib in a JSF page? I tried the following:
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>but I get an error as:
    Invalid character used in text string ( <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> ).
    Please help!!
    Thanks.

    Hello Prasant,
    I think page fragments is what your after, one of the Sun guys did a good blog on page layout with jspf but i can't access the weblogs, but you could try this tutorial in the meantime:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html
    Then search the weblogs when its available. i hope this helps
    Cheers
    Gaz

  • How to use HTML tags inside JSF pages

    I am creating a Menu using dataTable and outputLink in a JSF page.
    <div class="bodyarea">
    <div id="location">
    <ol>
    <h:dataTable value="#{menuItem.breadCrumb}" var="bread" >
    <h:column>
    <li>
    <h:outputLink id="crumbID" value="#{bread.menuLink}">
    <h:outputText id="crumpName" value="#{bread.menuLabel}" style="width: 165px;"/>
    </h:outputLink>
    <li>
    </h:column>
    </h:dataTable>
    </ol>
    </div>
    </div>
    I want to use <li> HTML tag as shown in code above before and after every <tr> tag formed, but when i run it and see view source, this is how it shows:
    NOTE: you can see it has thrown out of <table> tag itself.
    <div class="bodyarea">
    <div id="location">
    <ol>
    <li>
    </li>
    <table>
    <tbody>
    <tr>
    <td><a id="_id0:0:crumbID" href="/eApps/admin/loginPage.jsp?MenuItem=-1"><span id="_id0:0:crumpName" style="width: 165px;">Home</span></a></td>
    </tr>
    <tr>
    <td><a id="_id0:1:crumbID" href="/eApps/admin/loginPage.jsp?MenuItem=3~-1"><span id="_id0:1:crumpName" style="width: 165px;">HIM Admin</span></a></td>
    </tr>
    </tbody>
    </table>
    </ol>
    </div>
    </div>
    Can some one help me, how do i use HTML tags inside <h:dataTable>.
    Or is their any other way i should form my Menus, to fully utilize to HTML tags.
    Thanks
    Ravi

    Hello,
    You can embed the verbatim elements in your datatable, ie,
    <h:dataTable value="#{menuItem.breadCrumb}" var="bread" >
      <h:column>
        <f:verbatim><li></f:verbatim>
        <h:outputLink id="crumbID" value="#{bread.menuLink}">
          <h:outputText id="crumpName" value="#{bread.menuLabel}" style="width: 165px;"/>
        </h:outputLink>
        <f:verbatim></li></f:verbatim>
      </h:column>
    </h:dataTable>

  • How to use frames in a jsf page

    hi all,
    I need my page to be divided into three frames each frame with scrollable option. Each page should be able to display different jsp pages.Can anyone give a solution how can i implement this in a jsf page
    regards,
    Prasant

    Hello Prasant,
    I think page fragments is what your after, one of the Sun guys did a good blog on page layout with jspf but i can't access the weblogs, but you could try this tutorial in the meantime:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html
    Then search the weblogs when its available. i hope this helps
    Cheers
    Gaz

  • How to set cursor property from "snap-to-plot" to free?

    dear all,
    is there any one know how to set a cursor property from "snap-to-plot" to "free"?
    this cursor is in a XY graphy
    i couldn't find coresponding property in the XY graph property node
    thank you
    Jack

    It looks like there are different property names depending on your labview version.
    You need to select the ActCrsr and then use the Cursor.Lockstyle property in LV7.1
    You need to select the ActCrsr and then use the Cursor.CursorMode property in LV8.2.

Maybe you are looking for

  • URGENT: Java stored procedure on oracle 92 database is not working

    Hi, I am having an issue regarding java stored procedures. I have created a java class that uses the bouncycastleprovider ( bcprov-jdk13-141.jar ) to encrypt strings. I tested against the version of the java virtual machine that comes bundled with or

  • How to distribute a form with multiple submit buttons?

    I have a form that has multiple submit buttons depending on the information that is being entered and then who the information should go to.  When I try to disbribute the form, I get an error message stating the following, "Acrobat is unable to distr

  • Creating Sales Text By BAPI

    Hi I am uploading sales text by using bapi BAPI_MATERIAL_SAVEDATA ... when i am upload  the  long text it displays Material Created or extenden but it does appear in mm03 sales text... I have coded like this.. {    LOOP AT IT_LT.     BAPIMATHEAD-MATE

  • Dynamic TOC

    Greetings, I had a meeting with a client, who demoed Oracle's User Productivity Kit (UPK). One of the interesting features is displaying a TOC based on the user role. The user selects a role and the TOC displays the topics based on the selected role.

  • Sky Go - Use Silverlight Fullscreen Pinning Mode

    I have two monitors, and I often watch Sky Go on monitor A while working on monitor B. However, whenever I fullscreen Sky Go, and click on a second monitor, Sky Go exits fullscreen mode. Silverlight has had Fullscreen Pinning Mode (where it remains f