Value binding an object to the request scope

Hello,
In one page I have the results conducted from doing a search. Each row displayed in that page represents a user, and there is a link within each row that will facilitate the editing of that user in another page.
Here is the code for the link in the "results" page:
<h:column>
     <h:commandLink id="editLink" action="#{pc_Search_user_results.editUser}">
          <h:outputText value="Edit" />
          <f:param name="userId" value="#{user.id}" />
     </h:commandLink>
</h:column>My second page (that is, the one that will allow edits to be made) expects a "User" instance to be available as part of the request:
<managed-bean>
  <managed-bean-name>pc_EditUser</managed-bean-name>
  <managed-bean-class>pagecode.jsp.EditUser</managed-bean-class>
     <managed-bean-scope>request</managed-bean-scope>
     <managed-property>
          <description>
                    Should be an instance of the user that was selected from
                    the search results page.
          </description>
          <property-name>user</property-name>
          <value>#{requestScope.user}</value>
     </managed-property>
</managed-bean>I have that variable defined in the EditUser backing bean for the "edit" page with the appropriate getter/setter. The problem is that instead of getting a "User" instance in the bean, I'm getting a null value for it instead. I'm trying to set the instance in the method associated with the command link in my "results" page. That is, in my SearchUserResults bean, which is the backing bean for my "results" page, I have the following code:
public String editUser() {
        HtmlCommandLink link = this.getCommandLinkById("editLink");
        String id = null;
        Map map = link.getAttributes();
        List children = link.getChildren();
        for (int i = 0; i < children.size(); i++) {
            if (children.get(i) instanceof UIParameter) {
                UIParameter parm = (UIParameter) children.get(i);
                id = (String) parm.getValue();
                break;
        User user = null;
        Iterator iterator = this.users.iterator();
        while (iterator.hasNext()) {
            user = (User) iterator.next();
            if (id.equals(user.getId())) {
                break;
        facesContext.getApplication()
                    .createValueBinding("#{requestScope.user}").setValue(
                        facesContext, user);
        return "success";
    }All I want to get in my backing bean for the "edit" page is a valid "User" instance, which should be set when a new instance of EditUser is created per request. Obviously, I'm not understanding what is happening for this simple scenario. Please chime in with suggestions or explanations! Thanks.
Jeff

Frank,
Thanks for your reply.
Yes. I have dragged the collection called "GetYearsDataRequest" (which has 2 attributes) to the view as to create new form with submit button. Then i dragged the method on the button to bind the method called "GetYears".
But actually the method GetYears is required complex type "GetYearsDataRequest" as input. I see the collection and the object/complex types are seperated form visual perspective.
I tried dragging method to create parameter form, but unfortunately it created GetYearsDataRequest as text field rather I would like to see its attribute in the form.
I am not sure how to bind the attributes to the input object/complex type (GetYearsDataRequest). I think I am missing this step. Pls help me on this.
I hope I answered to your question.
Please let me know if you need more info.l
Thanks!
Rajasekar.

Similar Messages

  • How to get the request scope values?

    Hi,
    I have one question about Struts validate framework question is How can i get the request scope values when the validate method throws an exception?
    My scenario is I have some values in the request scope in one page. After submitting the page the validate method throws an exception, then the errors were displayed in the page and it ask for provide correct information. However, at this time the values in the first request will become null. How can I get those request values?
    Request.setAttribute(�con�, conn);Link after click this link user will display with user reg. form with user details input fields. After submitting he user details form if user provide some invalid information then validate method in Action form will throw errors and displayed the User details form with errors. However, the request attribute �con� will become null at this point of time. How can I get the user request attribute in user details form?
    Assume request have more than 100 values.
    Waiting for answer...
    Regards,
    Bhaskar Reddy

    Your code is probably fine, and you are probably running into http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6497210
    See also http://forum.java.sun.com/thread.jspa?messageID=9419890
    SUN needs to fix a few bugs for this to work...

  • Put an Object in the session scope

    I write a logon() action . Inside, i retrieve informations about user logon from a UserForm Object define in the faces-config.xml file with a request scope. So I want to set a business Object called User with the UserForm's values. Then i need to put the User Object in the session scope but i don't know how to do ?
    Can someone help me ?
    Thanks.

    I write a logon() action . Inside, i retrieve
    informations about user logon from a UserForm Object
    define in the faces-config.xml file with a request
    scope. So I want to set a business Object called User
    with the UserForm's values. Then i need to put the
    User Object in the session scope but i don't know how
    to do ?
    Can someone help me ?
    Thanks.The session attributes are available via the "sessionMap" property of the ExternalContext for this request. So, from within your Action, you could do something like this:
    User user = ... set up your user object ...;
    // Get FacesContext for this request
    FacesContext context =
      FacesContext.getCurrentInstance();
    // Store user object in the session map
    context.getExternalContext().getSessionMap().put("user", user);Craig McClanahan

  • Command Link in the af:table Component can not Work in the Request Scope

    Actually, the problem is that when we click on the command link, the action method #{overview.goToLinkAction} is not triggered.
    Here is the codes of action method "goToLinkAction" on the backing bean:
    public String goToLinkAction() {
    String linkString = (String) AdfFacesContext.getCurrentInstance()
    .getProcessScope().get("linkString");
    System.out.println("Link String is: " + linkString);
    return "";
    The data object list "listOfTransefer" for af:table is composed first time when the page is initialized.
    public void onPageLoad() {
    this.listOfTransfers = composeListOfTransfers();
    But when the commandlink or commandbutton is clicked to pose the form, this onPageLoad method is ignored by using PagePhaseListener:
    public void beforePhase(PagePhaseEvent event) {
    FacesPageLifecycleContext ctx =
    (FacesPageLifecycleContext)event.getLifecycleContext();
    if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID && needReload()) {
    bc = ctx.getBindingContainer();
    onPageLoad();
    bc = null;
    public final boolean needReload() {
    if (!isPostback())
    return Boolean.TRUE;
    else
    return alwaysReload();
    protected boolean isPostback() {
    return Boolean.TRUE.equals(resolveExpression("#{adfFacesContext.postback}"));
    That means the method "onPageLoad()" may not be invoked when the commandlink is clicked.
    Is there any way to resolve this problem without changing the scope of the backing bean to "session"?
    Your response will be very helpful for us.
    Thanks

    Hi,
    if you implicitly say that this works if the managed bean is in session scope then the problems seems to me that one of your evaluation criterias is reset in the request scope, which I think most likely is the needReload() method. Did you add debug statements to the methods to see where exactly it gets stuck?
    Frank

  • How To Pass the Request Scope To Another Class

    In my ListThread class, I first retrieve some of the text fields; i.e., request.getParameter( ... );
    Thereafter, I want to pass the request scope together with some parameters to another class; SiteUtil.java., for some further processing. This is what I do:
    public final class ListThread extends HttpServlet
          public doPost( HttpServeltRequest request, HttpServlerResponse response)
                      throws ServletException, IOException
          String offset = request.getParameter( "offset" );
          String size = request.getParameter( "size" );
          SiteUtil.prepareNavigate( request, offset, size,
               MessageInboxConfig.ROWS_IN_THREADS );
    }This is my SiteUtil.java:
    import javax.servlet.http.HttpServletRequest;
    public class SiteUtil
       public static void prepareNavigate  
         (HttpServletRequest request, int offset, int   
                         collectionSize, int totalRows)
          int startOffset = offset + 1;
          int lastOffset = offset + collectionSize;
          request.setAttribute("StartOffset", new Integer(startOffset));
          request.setAttribute("LastOffset", new Integer(lastOffset));
    }Can I pass the request scope and save attributes in the scope this way?

    You can pass the request to that method as a parameter, yes, and you can even modify the request there. The request is just an ordinary Java object, so ordinary Java rules apply. Your code looks fine to me too.
    However don't try to store the request for future use, since after the response is sent back to the client, the request object is never used again. A new one is created for the next request.

  • When releasing a transp. req.not all object in the request could  be locked

    When trying to release a transport request I get error message that "not all object in the request could  be locked. Do you want to release them anyway"
    I found an unreleased request (from someone else) containing few objects from my request. However I do not know the owner of that request (and I can not felete it). What to do?
    If I release the transport anyway what could happen?

    Hi Tina,
    If ur sure that u only want to release object which u have created and not the other objects then proceed in following way.
    1. Go to SE10 and click on create button
    2. u will get a popup select the 3rd radio button(ToC)
    3 Give the decsription of the Tp
    4. u will get  anext screen here in menu select request
    task->object lise ->Include object (new screen) here u select radio button freely selet obkect -> then new screen then selected the radio button selected objet. Here u give ur object and those object will be store in the created request then u can transport
    Regard
    Anees Ahned

  • Can't scale the objects. The requested transformation would make some objects too small to use.

    How does one remedy this Adobe error message? "Can't scale the objects. The requested transformation would make some objects too small to use." This one always gets me. I'll spend more time trying to find the object in question. This has happened in almost al versions, but this time it's CS5.

    Hmm, possible solution would be to select your object(s), scale them to 90%, and then hit Cmd+D or Control+D to repeat the transformation. I read that sometimes if you scale down too much and too fast it can cause this message.
    Hope this works for you!
    Michael

  • I am trying to copy a document and I keep getting the error "Can't paste the objects. The requested transformation would make some objects fall completely off the drawing area."

    I am trying to make duplicate documents with minor adjustments to each and when I try to copy the artwork from one document and paste it into the new document I keep getting the error "Can't paste the objects. The requested transformation would make some objects fall completely off the drawing area." Both documents are exactly the same size, res, color format etc. I even tried to drag and drop and get the same error message. Anyone know what I can do to resolve this issue?

    Try scaling the view size down to 6% or so and then do a Select All. See if there are objects off the artboard which may be causing this error. Most often you will see this if there were guides dragged from a ruler which were selected by dragging the white arrow and then deleted. This leaves the anchor points at the edge of the work area.

  • Transport Release Error: Not all objects in the request could be locked.

    Hi all!
    I hope you can help me with this one.
    We need to transport a particular request in our QA and Production client. However, upon releasing of the transport request number, a warning/error message appeared on the screen:
    'Not all objects in the request could be locked. Do you want to release anyway?'
    I tried to display the error and below is the object messages:
    Object messages: R3TR TABU ZLIFNR
    Task F5DK900107 belongs to a different category
    I don't know what that means, but I noticed that there are too many objects under the customizing task which I think is not part of the latest customization. I'm not sure what to do, I hope somebody could give me some advise.
    Thank you very much.
    Regards,
    April

    Hi!
    There are many IMG activities under that same request which is not supposed to be transported to QAS. Is it possible to transfer the IMG activity and other customization into a new transport request? if possible, how?
    I'm thinking if I can just try to change/save again the new configuration to a new transport request number. But if there's an easier way to solve this problem, I will consider that option.
    =) Thank you...

  • Conflict start: You tried to bind an object under the name abc.Scheduler

    I have deployed my application on the WLS which is configured for clustred with 2 managed server and one admin server in the same machine. I see the below error on both of the managedServer consoles. can any one please help me resolving this issue.
    <Conflict start: You tried to bind an object under the name abc.Scheduler in the JNDI tree. The object from -2433108061996587758S:192.168.0.61:[7014,7014,-1,-1,-1,-1,-1]:SingleDomainClusterTake2:ManagedServer1 is non-clusterable, and you have tried to bind more than once from two or more servers. Such objects can only be deployed from one server.>
    Regards
    Suresh.

    Hi Jay,
    Below is the code snippet where I am binding the Schedular Object to a JNDI abc.Schedular and I got the above error message when I trying to deploy the application in clustered environment.
    Code Snippet where binding the Schedular Object
    private static final String JNDI_NAME = "abc/Scheduler";
    Hashtable ht=new Hashtable ();
    InitialContext context = new InitialContext();
    scheduler = new Scheduler();
    scheduler.setStorage(new DatabaseSchedulerStorage());
    context.bind(JNDI_NAME, scheduler);
    Code Snippet for looking up the schedular object
    protected Scheduler getScheduler() throws NamingException {
    if (scheduler != null) {
    return scheduler;
    Scheduler s=null;
    if(workaround){
    s=((ThreadManager)SchedulingServlet.getThreadManager()).getScheduler();
    }else{
    InitialContext context = new InitialContext();
    s = (Scheduler) context.lookup("reactor/Scheduler");
    if (s.getStorage() == null) {
    s.setStorage(new DatabaseSchedulerStorage());
    scheduler=s;
    return scheduler;
    I have added "ht.put(WLContext.REPLICATE_BINDINGS, "false");" to get rid of the conflict error but I what this object to be clustrable and you please let me know how do I make this object clustrable.
    I am using quartz schedular.
    Regards
    Suresh.

  • Locking when using a component as an object in the application scope...

    I have a component that I am building right now that hold
    application settings that are stored in a database table. The
    settings are maintained in a structure "variables.settings" within
    the component and can only be accessed by get and set methods. I
    use the following to create the instance of the object:
    <cfset application.settings =
    createObject("settings","component").init() />
    Now when getting a setting I do not think locking is needed
    as its just reading the value and I am not really concerned with a
    race condition...
    But when using the set method which will update the value of
    the setting.... should I be locking that as technically the object
    is in a shared variable scope? Or is it safe because its within the
    cfc/object?
    If locking is needed, would I need to lock when using the set
    method? or can I just build the lock into the set method so that
    its always there?

    To disagree with craigkaminsky, I think you only need to lock
    if you are
    concerned about race conditions and what could happen during
    a 'dirty
    read' and|or conflicting writes.
    A lot of developers have an old impression of ColdFusion that
    one *must*
    lock all shared scope variable access to maintain a stable
    application.
    This dates from the ColdFusion 4.5 days where there where
    bugs in
    ColdFusion that could cause memory leaks and eventual
    application
    instability if one did not lock shared scope reads and
    writes. This has
    long been fixed, but the advice persists.
    So now it is only a matter of your data and what would happen
    if one
    user read an old value while it was in the process of being
    updated by
    another user. Or could two users be updating the same value
    at the same
    time and cause conflict. If either of those two statements
    are true,
    then yes you should use locking as required by your
    application.
    But if they are both false and it does not matter that user A
    might get
    the old value microseconds before user B changes it. Or there
    is no
    concern with user A changing it once and user B changing it
    again to
    something different moments later without knowing the user A
    has already
    changed it. Then locking is probably unnecessary.
    There can be a cost to over locking shared variable writes
    and|or reads.
    Every time one creates a lock, one is single threading some
    portion of
    ones code. Depending on how the locking is done, this single
    threading
    may only apply to individual users or it may apply to every
    single user
    on the entire server. Either way, too much of this in the
    wrong places
    can create a significant bottle necks in ones application if
    too many
    user requests start piling up waiting for their turn through
    the locked
    block of code.

  • Binding huge object to the jndi tree.

    Hi we are loading all the master tables in to objects at the app server startup (SUN ONE 7) and then binding the whole object to the jndi tree. All the tables data in text files comes to about 5 MB and the serilized object with data to about 8 MB. But when the app server tries to bind the object the app server process consumes over 500MB of ram and gives OutOfmemoryError as the total ram is 512MB. why is it consuming so much memory. It does bind an object of about 5 MB but when trying to lookup subsequent to the first lookup it fails. Is this a bug or what??? the same thing works perfectly with Weblogic and Websphere and also Weblogic is very efficient in memory consumption and response time is amazing. For a 5 MB object the lookup takes about 5Secs in Weblogic and about 15Mins in Sun One. We might have to drop the Sun One App Srv and go for Weblogic though we dont want. This same thing is working with about 4MB object in Sun One but takes about 45 Mins to 1 Hour to finish the serialization etc for jndi .Kindly provide some guidance.Thanks in advance.

    True. At the end I configured the value as a "server property". The cool thing about configuring the jndi tree is that it is replicated in a cluster.
    Obviously the values that I inserted affected all the applications, like the url of our SOA server.

  • How to declare value null to object at the end of jsp page.

    Hi
    I have two doubts.
    1. Im getting request from request.getParameter() method. i stored that value in one object. after process completion i have set null value to object at the end of jsp page.
    2. I declare jsp scriptlet within the javascript. in that jsp scriptlet i set session.setAttribute() values. i want to get the session.getAttribute value after javascript code completion.
    i tried but i got jasperException.
    please help me to solve this problem
    Thank u in advance

    Hai Sundaram,
    when ever u got the param from request at that time only u set the same parameter to null..
    i am not sure abt this is my idea only

  • Objects in the requests

    Dear Experts,
    We have a datasource in R/3 i.e 0FI_AP_4. The extract structure is DTFIAP_3.
    We have enhanced this datasource with some fields & have written some ABAP code in cmod to fetch the data into the enhanced
    fields.In this process some requests have been generated.
    Now my question is we have not made any note of these requests, we are not sure to how many requests these objects are
    assigend.In this case how to know that these objects and the changes are assigned to which requests ?
    I want to transport these objects and changes from R/3 Dev to R/3 Prod.
    Please guide me in this way.
    Regards,
    Bhadri M.

    Hello,
    For standard objects you should not change the development class...Orgingal system etc.
    Leave them to be in default, Warning: Dont change anything from "Object Directory Entry" for Standard object.
    For 0FI_AP_4
    Procedure 1
    Go to rsa6.
    Select 0FI_AP_4.
    Click on Object Directory from Application toolbar.
    Assign your Dev class ZBW.
    After the procedure 1
    Double click 0FI_AP_4 (from rsa6)
    Double click DTFIAP_3 (Extraction structure)=> You will be viewing (Dev class: DTFIAP_3, Original sys: SAP, Orginal lang : DE)
    Leave all them to be in default.
    Scroll down to find your append structure ZDTFIAP_3 from the component tab.
    Double click ZDTFIAP_3.
    Use Go to menu and Check the Dev class.
    If its is $TMP, Go in change mode and assign your Dev classZBW else leave default.
    Take care...Your working in standard objects..
    Edited by: Chandiraban singu on Sep 8, 2009 8:46 AM
    Edited by: Chandiraban singu on Sep 8, 2009 8:55 AM

  • Ajax and the Request scope

    Hi,
    I have a cfm page with a html div tag. When the page loads a
    cfc function is called which in turn does a cfinclude to populate
    the div tag. If I do a <cfdump var="#request#"> in the
    included page, it outputs the request variables fine.
    However, when the user clicks a button an ajax call is made
    to another cfc function which includes a cfm file again and returns
    the output of the function (as a cfsavecontent var) back to the
    original page and then this content is displyaed in the div tag. My
    problem is when I try to use a request variable in the second
    included page it is not available.
    I think this may be because the page is called using
    XMLHttpRequest instead of HttpRequest?
    Does anyone know if this is the case?
    Thanks.

    Have you tried using CFDIV?

Maybe you are looking for

  • Pass a shopping cart attachmnet to the ERP purchase order using ECS?

    Does anyone know if it is poissible to pass attachments from a shopping cart to the ERP extended classic scenario? I know the attachments can be passed when using the classic scenario, I alos know that the attachments will pass to the local SRM purch

  • JSPM SPS13 Problem : com.sap.aii.adapter.axis.app

    Hello all, For the PI 7.00 SP10 server  we have applied a SP13 patch .All the Java patches are applied except SAP_XIAF we are gettting an error : Error: Aborted: development component 'com.sap.aii.adapter.axis.app'/'sap.com'/'SAP AG'/'7.0013.20071224

  • Automatic creation of deliveries in back ground

    Hi All,           I want to create a automatic delivery via background scheduling. I have created the variant for the program RVV50R10C. I have created the role. can u please tell me how to assign the role in the program? The role field in user role

  • Error in customerInfo page

    Hi i am getting the following after submiting the customerinformation in customerinfo.jsp CONTAINER:atg.service.pipeline.RunProcessException: An exception was thrown from the context of the link named [priceOrderTotal].; SOURCE:java.lang.NullPointerE

  • Hong Kong/China Cals missing holidays?

    Has anyone else noticed that the HK and China calendars (from apple) do not include Chinese New Year!? Its the biggest holiday of the year. Is this some glitch only I'm getting? Norm