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.

Similar Messages

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

  • Howto change property of javabeans based data control?

    Hi,
    I have a swing application which displays a combobox. This combobox is bound to a javabeans based model using ADF.
    The combobox is enabled/disabled based on a value in another combobox, so sometimes the combobox is enabled, sometimes it's not.
    We've currently implemented this using an action listener, which call comboBox.setEnabled(false).
    This works, but when you refresh the iterator binding for the panel, the combobox is always enabled. I assume this is caused by the fact that the adf xml file describing the javabean contains the following attribute: IsUpdatable="true".
    How can i programatically change this attribute? Can i set a property for the jcombobox control binding, or can i change the AttributeDef used by the combobox?
    Thanks,
    Andrej

    How do i programatically change an adf javabeans based control value from editable to not-editable?

  • I keep getting this error message and Firefox won't start....Exc in ev handl: Error: Error setting property on NPObject!

    Firefox won't start and this message keeps coming up....I uninstalled and reinstalled....but didn't help...
    Exc in ev handl: Error: Error setting property on NPObject!

    Disable "McAfee Site Advisor" extension which was just updated to 3.4.0, which probably took it out of the addons block list.
    * "Ctrl+Shift+A" > find McAfee Site Advisor and use "Disable", and then restart Firefox.
    * Do a Google Search no problem
    * It seems that if you re-enable Site Advisor again, and restart Firefox you are okay. At least you know where to look if you get the error again or Google searches slow down.

  • Setting Property at design time and run time differ outputs

    On AI OCX Object I have set property in BUFFER>>Number of Scan to acquire = 600, Allocation Mode = Host Memory, Return data type = scaled data only And in Clock >> Clock=Scan, Clock Sourec Type = Internal,Scan/Second = 600 And in CONDITIONS>> Condition=Stop and Continuous..
    But when I want to set them at runtime I am not getting proper output
    I have defined at runtime...
    CWAI1.NScans = 600
    CWAI1.ScanClock.Frequency = 600
    CWAI1.AllocationMode = cwaiHostMemory
    CWAI1.ScanClock.InternalClockMode = cwaiFrequency
    CWAI1.ScanClock.ClockSourceType = cwaiInternalCS
    CWAI1.UseDefaultBufferSize = True
    CWAI1.Configure CWAI1.start
    Please guide me ... where I am gettin
    g wrong
    Best Regards"

    Hmmm, it looks like everything you have is correct. Except that it appears you haven't specified the channels you want to acquire from. I would expect to see something like this:
    CWAI1.Channels.RemoveAll
    CWAI1.Channels.Add "1,2,3"
    I have attached one of the shipping examples that also programatically specifies the properties. You might use it as a comparison to your code. I hope this helps.
    Regards,
    Russell
    Attachments:
    FiniteAcquisition.zip ‏4 KB

  • JSP set property

    Hi all,
    I have never had luck with the following tag either. set property seems to be picky about the variable name. In my previous post ( btw i am using Tomcat 5.0 ) i mentioned that I had problems with variable that had the second letter in capital letter for example nLoc didnt work whereas nloc did. ( any ideas why ?? )
    <jsp:set property name = "name_of_my_bean" property = "*" />
    The above tag would ( as was supposed to ) reduce a lot of typing. The bean i am using have alteast 25 properties and setting them one by one makes JSPs huge.
    This tag does not throw any errors, it just doesnt set any properties.

    I figured it out for myself.
    In order to get the setproperty="*" to work you put it nested inside the useBean tag so
    if you have a bean called test to set all the properties do
    <jsp:useBean id="myTestBean" scope="page" class="com.mycompany.mypackage">
    <jsp:setProperty name="myTestBean" property="*" />
    </jsp:useBean>that DOES set all the properties of a bean, so if you have an object with 10 properties you dont have to write 10 set property tags.

  • 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 property classes at runtime.

    Well, as the subject line says my question is plain and simple. I don't see any property for this in SET_ITEM_PROPERTY built-in.
    Currently a form has 10 subclassed blocks and views. These blocks have almost similar/definite number of items. At a time only one block with its canvas will be shown to the user. Instead of using so many sub-classed objects, I would like to use only one block and canvas. Now I am looking get getting just property classes from the 10 child forms, which I am looking forward to apply to the common block and items. Any other ideas for the same also appreciated.
    Thanks,
    -- Raam.

    alsalamu alykom
    I think there is no way to set property classes at runtime.
    u must loop through the objects

  • Read a property in the set-property tag

    How i can read a custom property defined in struts-config by adding <set-property property="customproperty" value="CustomValue"/> ??
    I want to put some extra info about every action in the struts-config.xml and then read it from the action or actionMapping classes in run-time.

    Hi,
    I found it!!
    The answer is: extend the ActionMapping (or the BC4JActionMapping for Oracle jdev developers) And add the extra-atributes (with the same name as the value in the <set-property> tag ) with their setter and getter methods.
    Then add to <action> in the struts-config.xml the atribute className:
    <action path="/logon" className="MyActionMapping">
    <set-property property="customProperty" value="SomeValue" >
    </action>
    or,
    change in the web.xml the mapping param:
    <init-param>
    <param-name>mapping</param-name>
    <param-value>MyActionMapping</param-value>
    </init-param>
    Then, in the Action wich receive the ActionMapping object, cast to MyActionMapping and get the atributes with their setter and getter methods:
    ((MyActionMapping)mapping).getCustomProperty();
    i hope this help to others with the same problem.

  • What is the need for setting property data inside the JMSMesage

    Hi
    Could anybody please let me know
    *What is the need for setting property data inside the JMSMesage??
    For example i have a seen a similar example as shown ??
    I have seen a
    Message.setStringProperty("Sport","Basketball");
    and also please tell me how can the MDB recievies this property data ??
    Thanks in advance .

    raviprivate wrote:
    Could anybody please let me know
    *What is the need for setting property data inside the JMSMesage??
    For example i have a seen a similar example as shown ??
    I have seen a
    Message.setStringProperty("Sport","Basketball"); Look at the detail JMS documentation on [Message Properties|http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Message.html] .
    >
    and also please tell me how can the MDB recievies this property data ?? MDB onMessage method argument is the Message object and if you look at the documentation, Message interface has getter methods to retrieve the properties.

  • Setting property attribute values for multiple selected objects.

    Hello,
    Is there an easy way to set the attribute property values for more that one selected Table Operator Attribute (column) at a time. For example the target table has over 100 columns but I only want to INSERT/UPDATE 10 of those columns. The generated MERGE, INSERT and UPDATE statements will perform DML on all of the columns in the target table, setting the 90 columns with no mapping set to NULL. This is due to the Loading Properties 'Load Column when Updating Row' and 'Load Column when Inserting Row' both default to Yes. I would like to select multiple Attributes in the Table Operator and change the 'Load Column when Updating Row' and 'Load Column when Inserting Row' to No. This is similar to what you were able to do in Oracle Forms 9.0 Designer select multiple Items in a Block and change the properties en-masse.
    Thanks

    Hi,
    Using OMB scripting to set attribute properties in a data mapping sort of defeats the purpose of utilizing a graphical user interface to define and set properties for a data mapping? Surely the GUI data mapping tool was created to get away from writing scripts and scripting would also require that you know the name of the data mapping, table operator and the set of attribute names for which you have to write one line of script to set each property value, i.e. 90 lines to set 90 attribute values.
    Cheers,
    Phil

  • Strange Runtime Error - Error setting property 'page1' in bean of type null

    All I have here is a treenode with its URL set to a web page. When the node is clicked, I get this:
    ===============================
    [#|2006-07-25T09:39:20.204-0600|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=16;|WebModule[/HNESWebApp]org.apache.jasper.JasperException: Error setting property 'page1' in bean of type null
    javax.faces.FacesException: org.apache.jasper.JasperException: Error setting property 'page1' in bean of type null
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:327)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
    at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:311)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at ccic2s.netsvr.hnes.web.hneswebapp.login.LoginFilter.doFilter(LoginFilter.java:198)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
    at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
    at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
    at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
    Caused by: org.apache.jasper.JasperException: Error setting property 'page1' in bean of type null
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at sun.reflect.GeneratedMethodAccessor200.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
    at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
    at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    ... 49 more
    |#]
    ======================
    Any ideas?
    TIA

    Okay, I found it - my bad but this might help you..
    Turns out the managed-beans.xml (and possibly other files /directories) under WEB-INF were set to read only due to the CM tool I am using - these files were checked in at one point (probably shouldn't have been). I thought I got them all but had missed a few.
    So the moral of the story is beware of setting read-only files!

  • Scope and Objectives of making java swing scientific calculator

    I am going to write code for java swing scientific calculator..... can any body help me to write scope and objectives of this project.... please please :-(

    If this is for school work, then defining the scope is part of the problem. The only advice I will give you is that you only need to implement what the assignment specifies. It is probably intentionally vague so you can bite off way too much and not finish -- failure should teach you something too.
    I had just such an assignment in my software engineering class in college -- create a cross compiler from X to Y where X and Y where known instruction sets. That was the entire assignment -- plus the instruction sets for X and Y. My team looked at the allotted time and resources availabe and decided to do a minimal implementation.
    We where the only team to complete the assignment and all recieved A's because we accurately implemented the required solution and were able to evaluate the real problem--resource allotment--accurately.
    Each other team tried to add "extras" that would "guarantee" them an A grade. In actuallity it was just a lot more work than they could do though and it hurt them in the long run--No matter how good the work was to the point they had at the end of the semester, each student in the other teams only recieved a B or less grade in the class due to failure on that project. Resource allocation and planning--only you can do that for your team/project.

  • Error setting property in bean of type null

    Hi i have jsf page and input text
    a managed bean with property sum of type float
    i attached this property to the input text:
    <h:inputText id="adr" value="#{userBean.sum}"/>
    but when enter a value and submit the page
    it prints me error in the page:
    Error setting property 'sum' in bean of type null
    any idea?

    The message says that the userBean is null.
    Check your faces-config.xml.

  • Error setting property 'html1' in bean of type null

    Dear All;
    I am currently on site, and away from my team, so they send over additional screens, that i treid to add to the project i have with me, i added the model, i add the SRC folder, and the .JSPX pages, only when i run the pages, i get Error setting property 'html1' in bean of type null, i checked previous threads, and i know the error and accordingly i checked that the page def exists, which it does, and that all the managed beans are there, and linked to faces config, which they are, so i am just wondering if any1 has any idea, as to how to make the pages work...
    regards
    Halim

    hi frank,
    I cross checked, all the entries in the bean, with those in the JSPX source code, and chceked in the auto comment of the JSPX page the name of the bean, i have checked the faces config, i am going to remove the the new models and re-add them, just tell me if i need to add any files other than those:
    MODEL X folder, which contains the model
    JSPX folder, which contans the pages
    SRC folder in view controller
    And the faces config to web-inf
    thanks in advance man
    regards
    Halim

Maybe you are looking for

  • Adobe Acrobat 9 Pro will not download to my computer

    My main computer crashed and I am trying to install Adobe Acrobat 9 Pro to my new computer.  I keep getting an error message Error 1305.  Error reading from file D:\Adobe Acrobat 9 Pro\Data1.cab   I purchased the program about 3 years ago.  Being a $

  • Messages reverts to iMessage instead of MMS

    I used to have an iPhone and switched back to Android this past year. In group messages and only group messages, friends and family who still do have iPhones will text me but it randomly sends as an iMessgae instead of a normal mms. My phone number i

  • Mod_jk binaries or Studio11 FTP dowload

    I need compile mod_jk.so for Soalris10 and SPARC. So i ma two ways: the sorter: download mod_jk.so for SPARC from somewhere. the longer: install studio11 and then compile. Someone know from where i can download studio11 via FTP ?

  • Weird Hyperlinks Issue - Position-related?

    I have a PDF I'm trying to create which has 1 email and 1 web URL per page. I select the option in Acrobat to make urls from text. It reports 58 links created; this is correct...2 per page, 29 pages = 59 instances. However, not all of the links work,

  • Want multiple email accounts to download into 1 inbox

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/1033197 /questions/1033197]'' I have 5 email addresses, but I don't want to have 5 inboxes. Is there anyway to have all these email accounts download