Set Property to javaBean using JSTL

Hi all,
I have a custom object variable that I read from the session using JSTL.
<c:set var="someObj" value="${sessionScope.myObj}" scope="page"/>
Now i wan to set the obj into my JavaBean.
<jsp:useBean id="myBean" scope="request" class"ObjectA">
     <jsp:setProperty name="myBean" property="objA" value='????' />     
</jsp:useBean>
How may I achieve this?
I've tried the following ways:
value = ${someObj}
value = '<c:out value=$"someObj">'
value = 'someObj'
But none of them works. Any suggestion? I do not wish to have any scriplets.
Thank you.

Here is an example of how to do it:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
First Bean :
    <!-- create the first bean in the request scope-->
     <jsp:useBean id="firstBean" scope="request" class="com.test.testBean"/>
     <!-- output the default name -->
    <c:out value="${firstBean.name}" />
    <!-- set the name to a new value an output the new value -->
    <c:set   value="newName" target="${firstBean}" property="name" />
    <BR><c:out value="${firstBean.name}" />
    <P>
Second bean : 
    <!-- create the first bean in the request scope-->
    <jsp:useBean id="secondBean" scope="request" class="com.test.testBean"/>
     <!-- output the default name -->
    <c:out value="${secondBean.name}" />
     <!-- set the name to a new value an output the new value -->
    <c:set   value="secondbeanName" target="${secondBean}" property="name" />
    <BR><c:out value="${secondBean.name}" />
<P>
Bean reference:
    <!-- set the first bean beanRef to the second bean --> 
    <c:set   value="${secondBean}" target="${firstBean}" property="beanRef" />
     <!-- output the name property of the first bean bean ref -->
        <c:out value="${firstBean.beanRef.name}" />     
        <!-- change the name property of the second bean and the output the name property of the first bean bean ref -->
        <c:set   value="A completely new name" target="${secondBean}" property="name" />
     <br><c:out value="${firstBean.beanRef.name}" />     
    </body>
</html>where com.test.testBean is:
package com.test;
public class testBean {
     private String name = "My Name";
     private int value = 11;
     private boolean exists = true;
     private testBean beanRef;
     public boolean isExists() {
          return exists;
     public void setExists(boolean exists) {
          this.exists = exists;
     public String getName() {
          return name;
     public void setName(String name) {
          this.name = name;
     public int getValue() {
          return value;
     public void setValue(int value) {
          this.value = value;
     public testBean getBeanRef() {
          return beanRef;
     public void setBeanRef(testBean beanRef) {
          this.beanRef = beanRef;
}

Similar Messages

  • Dataobject scope and howto set property in javabean - n00b question?

    1. I try to use my JavaBean in uix page as DataObject ( with generated adapter ).
    It works fine for geter methods to render properties but hot to set properties ( call setters )?
    2. That JavaBean calls long select method in BMP entity bean and I wonder what is a "scope" ( as it is in jsp:useBean ) of my DataObject wrapped JavaBean.

    1. I try to use my JavaBean in uix page as DataObject ( with generated adapter ).
    It works fine for geter methods to render properties but hot to set properties ( call setters )?You'll need to use Java code in an event handler. Or, you can use
    the built-in UIX-Struts integration support, and let Struts automatically
    set the JavaBean properties.
    JDev 9.0.4 will include a <set> EventHandler that will provide declarative support for
    setting properties of JavaBeans, e.g., grabbing a property from the request and setting
    it on a JavaBean from entirely within UIX.
    2. That JavaBean calls long select method in BMP entity bean and I wonder what is a
    "scope" ( as it is in jsp:useBean ) of my DataObject wrapped JavaBean.If the DataObject is created during rendering, its lifetime is a single request.
    However, a DataObject wrapper that only lives for a single request can easily
    wrap a JavaBean that lives for multiple requests.
    I wouldn't worry about caching the DataObject wrappers - they're very lightweight.
    But if your JavaBean is expensive to create, then by all means cache that JavaBean.

  • How to get Document Set property values in a SharePoint library in to a CSV file using Powershell

    Hi,
    How to get Document Set property values in a SharePoint library into a CSV file using Powershell?
    Any help would be greatly appreciated.
    Thank you.
    AA.

    Hi,
    According to your description, my understanding is that you want to you want to get document set property value in a SharePoint library and then export into a CSV file using PowerShell.
    I suggest you can get the document sets properties like the PowerShell Command below:
    [system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
    $siteurl="http://sp2013sps/sites/test"
    $listname="Documents"
    $mysite=new-object microsoft.sharepoint.spsite($siteurl)
    $myweb=$mysite.openweb()
    $list=$myweb.lists[$listname]
    foreach($item in $list.items)
    if($item.contenttype.name -eq "Document Set")
    if($item.folder.itemcount -eq 0)
    write-host $item.title
    Then you can use Export-Csv PowerShell Command to export to a CSV file.
    More information:
    Powershell for document sets
    How to export data to CSV in PowerShell?
    Using the Export-Csv Cmdlet
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • 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

  • SET property step disappear when use Java SHA-1

    When I apply SET property with Java SHA-1, java.security.MessageDigest, the SET step disappear immediately. (It has been removed automatically.)
    My project requires for using SHA-1. How do I use SHA-1 hashing function in UCCX editor?
    Did UCCX editor support limited Java library?
    I'm using UCCX Editor with UCCX 8.0

    Hi, Anthony Holloway.
    I used to read your very useful SOAP in IVR tutorial, thump up!
    I have already opened a TAC case. They told me to change compatibility mode to Windows 2000 which I have changed it already.
    I also disable visual style in the property. No changes happens.
    I think my error/bug appears when I assign byte[] data. As an example:
         byte[] bArray = text.getBytes();
    "java.security.MessageDigest -> digest()" use this datatype for hashing function.
    But yours, Anthony, my opinion is your inline-style code maybe very complex to IVR for understanding while typical jre can understand it!
    Did you think so, Anthony?

  • Displaying a set of records using jstl

    hi i am new to jstl.my requirement is i want to display a set of records from my database using jstl.for eg i want to display 50 records per page and i want to navigate to other records using next and prevoius buttons and i need to put view and edit buttons in that page.can anybody give me a solution for this.urgent

    You may try the paging taglib ...
    http://www.servletsuite.com/servlets/pagertag.htm

  • Error using XML_ETL_UTILS: OMB02902: Error setting property DATATYPE of XML

    This error occurs at the time of executing menu option Tools->"Create Components From XSD/WSDL". (After the XML_ETL_UTILS expert module was already installed successfully). The error comes as a pop-up window with long stack of OMB script errors:
    OMB02902: Error setting property DATATYPE of XML_OBJECT: 0 while executing
    "OMBALTER PLUGGABLE_MAPPING '$pplug' ADD ATTRIBUTE 'XML_OBJECT' OF GROUP 'OUTGRP1' OF OPERATOR 'XS_$plug_name' SET PROPERTIES (DATATYPE,EXPRESSION,BUS..."
    ... and then more lines with errors. I wished I could attach a screenshot of the the pop-up window.
    If I could ask oracle folks familiar with the expert module XML_ETL_UTILS to help me out.
    Thanks,
    vr

    This is a bit of an odd one that can be resolved by creating an Oracle module in the project where you are creating your pluggable maps.
    It is a bug in OWB because OWB does not load the datatypes on demand when pluggables are being created so for now if you create an oracle module all the oracle types will be loaded then pluggables can be created which use these types. I should have put this in the expert's notes because its something I also fell over a couple of times, forgot about, then annoyingly remembered! ;)
    Cheers
    David

  • [svn:fx-trunk] 15267: Cannot set Spark Label or Spark RichText showTruncationTip property at runtime using bindngs or ActionScript .

    Revision: 15267
    Revision: 15267
    Author:   [email protected]
    Date:     2010-04-07 15:57:04 -0700 (Wed, 07 Apr 2010)
    Log Message:
    Cannot set Spark Label or Spark RichText showTruncationTip property at runtime using bindngs or ActionScript.
    QE notes:
    Doc notes: None
    Bugs: partial fix for SDK-25980
    Reviewed By: Gordon
    Tests run: checkintests
    Fix Label styles baselineShift and typographicCase so they work as documented.  The documentation is from TLF.
    QE notes:
    Doc notes: None
    Bugs: partial fix for SDK-25169, SDK-25210
    Reviewed By: Gordon
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-25980
        http://bugs.adobe.com/jira/browse/SDK-25169
        http://bugs.adobe.com/jira/browse/SDK-25210
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as

    I'd have to see the xml to say what, but 1009 is what it says - a null reference has no properties, it is null.
    Try tracing out SampleWebServiceCS.GetMember and you'll quickly see where along your .element.element path you have an error.
    (BTW, I've not used s:Operation before, but is your syntax correct?)
    G

  • 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 |

  • Can you set pager attribute using jstl c:out tag?

    I am trying to use the pager tag library from jsptags.com. The pager tag has a maxPageItems attribute. I want maxPageItems to be variable. I also want to use the jstl instead of scriptlets and expressions. Instead of writing
    <pg:pager
        maxPageItems="<%= myPageItems %>" >I want to write
    <pg:pager
        maxPageItems="<c:out value='myPageItems'/>">When I do this I get a java.lang.NumberFormatException: for input string: ""
    I think this issue is documented on the jsptags website. So maybe I have no choice but to use the expression format. I guess I should also mention that I am using jstl 1.1 and jsp 1.2 (implemented in tomcat 4.1.27)
    Has anyone tried this and had success?
    Did I provide enough information?

    Sorry, but you can't use tags as attributes to other tags (where would it end?)
    You're stuck with using <%= %> syntax.

  • Hw can i get arabic support in oracleAS using jstl: showing '?????' symbols

    Hello All,
    I am using OracleAS for portal deployment and portlets UI constructed by using jstl.
    i have used spring portlet jstl for the jsp pages.
    when i am trying to change the language, it is showing '?????' symbols.
    I have used correct unicode. i tested in pluto portal server. when i deployed in oracleAS,
    for english not a problem. for arabic it is showing as '????'.
    i have used this code to get arabic in pluto. same code i used. i am getting error.
    <c:set target="${pageContext.response}" property="characterEncoding" value="UTF-8" />
    <fmt:setLocale value="ar" />
    <fmt:requestEncoding value="UTF-8" />
    i know it is not setting charector encoding.
    i tried some other too like:
    <head>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    </head>
    and
    <%@ page pageEncoding="UTF-8" %>
    No improvement. please help me out of this.
    how can i get arabic support in oracle AS by using jstl?
    Thanks,
    Arun

    Only Apple Account Security could help at this point. You can try calling Apple Support in Canada - you'll have to find one of the several ways, such as Skype, to call an 800 number from outside of the relevant country - and ask for Account Security and see if they can help. Or you can find a friend who speaks Chinese and ask them to help you talk to Apple Support in China. There are really no other options that I know of.
    Note, by the way, that these are user-to-user support forums. You aren't speaking with Apple when you post here.
    Regards.

  • Populating combobox in jsp page from javabean using jsp:getProperty tag

    hi,
    i am new to jsp, so i don;t know how to populate a combobox in jsp page with productid attribute from a javabean called Bid . i want to have a code to automatically populating combobox using the attribute value from javabean.
    please reply me.
    <jsp:useBean id="bidpageid" class="RFPSOFTWARE.Bid" scope="session" />
    <jsp:setProperty name="bidpageid" property="*"/>
      <table  width="50%" align="center" border="0">
       <tr>
        <td  width="30%" align="left"><h4><b><label>Date (dd/mm/yyyy) </label></b></h4> </td>
        <td><input type="text" name="date" size="11" maxlength="10" readonly="readonly" value="<jsp:getProperty name="bidpageid" property="date"/>"  > </td>
      </tr>
      <tr> <td > </td> </tr>
      <tr>
        <td  width="30%" align="left"><h4><b><label>ProductId </label></b></h4> </td>
        <td><select name="productid" tabindex="1" size="1" >
          <option  value="<jsp:getProperty name=bidpageid" />Sachin</option>
          <option value="Hello">Vishal</option>
        </select></td>
      </tr>  and the javabean for Bid is as follow :
    import java.util.Date;
    import RFPSOFTWARE.Product;
    public class Bid{
    private Product product;
    private Integer bid_id;
    private String description;
    private Date date= new Date();
    public Integer getBid_id() {
    return bid_id;
    public Date getDate() {
    return date;
    public String getDescription() {
    return description;
    public Product getProduct() {
    return product;
    public void setBid_id(Integer bid_id) {
    this.bid_id = bid_id;
    public void setDate(Date date) {
    this.date = date;
    public void setDescription(String description) {
    this.description = description;
    public void setProduct(Product product) {
    this.product = product;
    }

    No Sir,
    I think I did not explained clearly.what I try to say is I dont want to use JSTL.I am using only Scriptlets only.I can able to receive the values from the database to the resultset.But I could not populate it in Combobox.
    My code is :
    <tr>
    <td width="22%"><font color="#000000"><strong>Assign To Engineer</strong></font></td>          
    <td width="78%">
         <select NAME="Name" size="1">
    <option><%=Username%></option>
    </select> </td>
    </tr>
    in HTML
    and in Scriptlets:
    ps1 = con.prepareStatement
              ("SELECT Username FROM Users");
              rs2=ps1.executeQuery();
              System.out.println("SECOND Succesfully Executed");
              while(rs2.next())
                   System.out.println("Coming inside rs2.next loop to process");
                   Username=rs2.getString("Username");
                   System.out.println("Success");
                   System.out.println("The value retrieved from UsersTable Username is:"+Username);
    In the server(Jboss console) I can able to display the username but I could not populate it in the Combobox .
    Can you now suggest some changes in my code,Please..
    Thanks a lot
    With kind Regds
    Satheesh

  • Getting a substring using JSTL

    Have string as below.
    <UL><LI>Required</LI></UL>
    Would like to get only the string "Required" with out any UL stuff.
    is it possible to get this using JSTL? if not how to get the substring "Required".
    Thanks.

    > I was trying to use for display only but <html:errors
    property="custName"/> is returning <UL> instead of a
    String.
    Do you happen to have that set up as the "errors.header" and "errors.footer" properties in your application properties file? You might consider removing the HTML markup and using JSTL to provide an unordered list when desired.
    Hope this helps.
    ~

  • How do you run a boolean on a hashmap using JSTL?

    I am trying to test a hashmap to see if it has a certain value using JSTL.
    <jsp:useBean> id="something_map" class="java.util.HashMap" />
         <c:set target="${something_map}" property="submitted" value="goodbye" />
         ${something_map.submitted}
         <c:if test="{something_map.submitted == goodbye}">
         worked
         </c:if>
    I am creating a hashmap with the jsp:useBean tag. i set the maps name to "something_map."
    Then I made a key called submitted and set its value to goodbye.
    When I display "something_map.submitted", it successfully displays "goodbye", but when I run the <c:if> and test to see if "something_map.submitted" is equal to "goodbye", it doesn't work. How do I run a boolean on the value of a hashmap?
    p.s., i already tried using scope variables, but they don't work so well when they are updated several times over many pages.

    cotton.m wrote:
    >
    Also, to the person who said that I left out a $, that was I typo. I have it in on the original code and it didn't make a difference.Well it's not the equals bit. JSTL is a scripting language not Java.Sorry for the red herring. It's been a geologic age since I've done anything JSP-ish. I wasn't sure how closely JSTL aligns with the Java to which it compiles.

  • How do I use jstl  to insert  links that passes sql info?

    Hi all,
    I'm using JSTL with sql and I want to create a link for every row so that the link would also contain the item in the first column of every row. But I keep getting stuck at saving the value. This is what I've tried:
    <c:set var="myName" value="test" scope="page"/>
    <tr>
    <c:forEach var="row" items="${name.rowsByIndex}">
         <tr>
    <c:forEach var="column" items="${row}">
         <c:if test="row =='uname'">
              <c:set var="myName" value="${column}"/>
         </c:if>
         <td>myName=<c:out value="${pageScope.myName}"/>"> <c:out value="${column}"/> </td>
    </c:forEach>
    </tr>
    </c:forEach>
    I either get a link of "edit.jsp?uName=$myName".
    Any ideas would be appreciated.
    Chris

    Introducing the <c:url> and <c:param> tags!
    <c:url value="edit.jsp">
      <c:param name="uName" value="${myName}"/>
    </c:url>Why the nested loops? When does row=='uname'? Could that ever occur?
    If you are after a specific column why not have one loop over ${name.rows} and get ${row.uname}?
    What server are you using?
    What version of JSTL?
    What is the taglib import you have made?

Maybe you are looking for

  • HDMI Connections:  To AVR versus direct to TV?

    Can you connect the HDMI from the ATV to the AVR (Audio Video Receiver); and then have the AVR HDMI to the TV? Then use the AVR remote to switch to the Apple TV?

  • ODBC driver for Win Server 2008 64-bit.

    I need help with installing the ODBC driver for Win 2008 64-bit. I'm not really familiar with Oracle products but anyway I was asked to install the driver. I downloaded Oracle 11g ODAC 11.1.0.7.20 which includes the Oracle ODBC Driver 11.1.0.7.0 from

  • How to use old gamepad

    I'm running 10.5.4 on an 08 regular macbook... I picked up some cheap games and was wondering there's any way I can get an old Gravis gamepad controller to work? It's a USB controller that did work with mac... It does seem to get recognized, but it d

  • DB Link problem on form/report 6i

    Greeting I have an problem on form 6i with DB Link , that When I have view Using the DB Link and want to use the view on form6i or report 6i, the report not work when call the run file but work through the builder and also on the form not work (Form/

  • Can't access my accout to make changes

    I'm trying to access my account activity and to deauthorize my computers but I keep getting an error message that says I can't connect and it suggests I update my clock, which I've done. Nothing helps. When I called tech support they hung up on me! I