Question about navigation in session scope

Hi.
I dont know how to resolve a problem or how to focus this stuff.
I'll try to explain myself.
Let say I have a page (a.jsf) with several links, all this links navigates to the same page (b.jsf) which shows the results.
For each link in a.jsf I have attached a bean with a logic, so If I click in link 1 I go to the b.jsf showing data read from the database.table1. If I clik in link2 I go to b.jsf showing data read from database.table2, and so on...
The beans are in session scope (and must be).
The first time works ok because I initialize the bean in b.jsf, read data and I show using a selecManyListBox to show it, but if I go back and select another link it goes to b.jsf, but it shows the old data, the data read the first time, because it never calls again the init method.
Somebody has talked about using an additional bean to control this but once the bean in b.jsf is created I don't know how to call again the init method in beanB (b.jsf)..
I have attached a very simple project to deploy in eclipse 3.3 and tomcat 6.0. In this example instead of read from database I read from an structure created in memory to simulate this.
Somebody could take a look and comment something about it.
http://rapidshare.com/files/197755305/_session-forms.war
Thanks

Hi.
I understand is the same doing in the action method in a button or a commnad, the project is just an example, my real app is a tree, so is not a question about a button or a command, is about the logic being in session scope. I don't know how to face it.
thanks

Similar Messages

  • [SOLVED] Question about systemd-user-session

    Hi!
    I'm trying to setup a systemd --user session (using user-session-units and xorg-launch-helper from aur).
    I have a couple of questions; this is my .xinitrc now:
    #!/bin/bash
    export BROWSER=chromium
    if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
    done
    unset f
    fi
    spacefm --desktop &
    compton -cGCf -m 0.9 -i 0.8 -D 5 --shadow-exclude 'g:e:Conky' &
    volumeicon &
    /home/federico/Script/touchpadoff_onboot.sh &
    #connman-ui-gtk &
    /home/federico/Script/calised-script &
    dimdaemon &
    tint2 -c .config/tint2/dragonauta.tint2rc &
    conky -p 5 -c Script/conky.conf &
    exec openbox
    1) is "if" statement required when using systemd-user-session? And if yes, how can I reproduce it?
    2) "conky -p 5 " will wait 5 seconds doing nothing. Will this mean that other .service will wait for it to finish? (i guess no, since they're executed in parallel).
    3) how can I export "chromium" as my default browser?
    Thank you very much!
    Last edited by nierro (2013-04-06 17:56:17)

    I followed everything in that wiki, and in KaiSforza and sofar github page.
    I finally managed to get my old method (autologin to vt and autostart x) to work together with systemd --user: i put in .xinitrc "systemd --user" and deleted everything else.
    So, my .config/systemd/user/ works. The problem is in the [email protected], i guess. I configured it like wiki says, mind to post here your /etc/systemd/system/[email protected]?
    Thanks.
    EDIT: here it is my [email protected]:
    # This file is part of systemd.
    # systemd is free software; you can redistribute it and/or modify it
    # under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    [Unit]
    Description=User Manager for %I
    After=systemd-user-sessions.service
    # This is needed for folks running Xorg on vt/1
    Conflicts=[email protected]
    [Service]
    User=%I
    PAMName=login
    # Note memory:/ required kernel memory CGroups support
    ControlGroup=%R/user/%I/shared cpu:/ memory:/
    ControlGroupModify=yes
    Type=notify
    TTYPath=/dev/tty1
    ExecStart=-/usr/lib/systemd/systemd --user
    Environment=DISPLAY=:0
    Environment=XDG_RUNTIME_DIR=/run/user/%U
    Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket
    [Install]
    WantedBy=getty.target
    and loginctl says my user has "1000" as UID.
    Last edited by nierro (2013-04-05 16:13:14)

  • Just simple question about java HTTP session mechanism...

    I have one simple question regarding the java HTTP Session Mechanism.
    1) Is there another alternative for the HTTP Session ? If have, what the alternative?
    2) I have been acknowledge that HTTP session is same as cookie system and others say have many different, where is the different..
    thanks

    1) You can always do your own session handling. But why bother when there is one there for you?
    2) The issue with sessions is how to identify the user from the request. Each session gets given a session id. The user has to send that session id with every request they make.
    The standard way is to use a session cookie, which only lasts as long as the browser session. The cookie with the JSESSIONID is sent with every request, thus the server can identify which session a user is in from their cookie.
    Of course you cannot assume that the browser will support cookies, so you need to encode all URLs with the method response.encodeURL(). That method puts the session id into the URL if the browser does not support cookies, or they have them switched off.

  • Question about navigation in finder sidebar

    Hi, I'm new to Mac, and I just bought a Macbook Pro Retina Mid-2012 15'' with Mountain Lion installed. I wonder if there is any keyboard shortcut to navigate to finder sidebar and right pane back and forth except the command-shift-G.
    Thank you.

    The Sidebar is not navigable by keyboard. All you can do is add an item to it by pressing command-T. A complete list of built-in keyboard shortcuts is here:
    OS X keyboard shortcuts

  • 3 question about cookie and session please.

    1. I know that session automatic use in JSP by default and save session id in cookie. I have code that show all cookie on my computer
    <%
         Cookie [ ] listcookie = request.getCookies();
         Cookie mycookie = null;
         for(int i=0; i<listcookie.length; i++)
              mycookie = listcookie;
              out.println("<tr><td> " + mycookie.getName() + "</td>");
              out.println("<td> " + mycookie.getValue() + "</td></tr>");
    %>
    When I first run this code it now show cookie. But when I click refresh it show session cookie. Why it not show session cookie at first time?
    2. I use tomcat on window. Is session on server is save as file. Which directory it save?
    3. I use method getCreationTime() to check first create session time and method session.getLastAccessedTime() to check last access session time. I have to file
    showsession1.jsp
    first time create is <%=session.getCreationTime()%>  <br>
    last time access is <%=session.getLastAccessedTime()%> <br>
    <a href="showsession2.jsp"> showsession2.jsp</a>showsession2.jsp
    first time create is <%=session.getCreationTime()%>  <br>
    last time access is <%=session.getLastAccessedTime()%> <br>When I open browser and run showsession1.jsp first time create and last time access is equal when I click link to showsession2.jsp it also equal. Why it still equal because it is second time that I access JSP file? It change when I refresh file showsession2.jsp

    1. When I first run this code it now show cookie. But
    when I click refresh it show session cookie. Why it
    not show session cookie at first time?
    When you first request the JSP, the session cookie does not exist on your PC and so your browser cannot supply it which means that the JSP cannot display it. The session cookie is created when the JSP returns the response to the first request. The browser can then send the cookie on subsequent requests.
    2. I use tomcat on window. Is session on server is
    save as file. Which directory it save?How the server saves the session info is server dependent and it's unlikely you will be able to view it.
    3. I use method getCreationTime() to check first
    create session time and method
    session.getLastAccessedTime() to check last access
    session time. I have to file
    showsession1.jsp
    When I open browser and run showsession1.jsp first
    time create and last time access is equal when I click
    link to showsession2.jsp it also equal. Why it still
    equal because it is second time that I access JSP
    file? It change when I refresh file showsession2.jspProbably showsession2.jsp was already in the browser cache and so there was no request to the server until you refreshed

  • Question about object retention and scope

    I have a hole in my understanding of Cocoa.
    I can create temp objects, to populate an array with, like this:
    for(int i=0;i<10;i++)
    myObject *tmpObj= [[[myObject alloc] init]] ;
    [[myMutableArray addObject:tmpObj]];
    [[tmpObj release]];
    But I don't understand why this works. If the tmpObjects get released, then why don't the ones in the array get released? (I can access the array later, and it is populated with myObjects.)

    If you create an object from scratch (alloc, etc) then it's up to you to release it.
    If you get an object from another method of the system you don't have to worry about releasing it. More than likely it's set to auto-release but it's not your responsibility.
    If you want to hold on to any object then you retain it if you didn't create it. Any object you've retained you're responsible for releasing.
    If you pass an object before releasing it's up to that object to hold on to it if it needs it.
    Links:
    http://www.stepwise.com/Articles/Technical/2001-03-11.01.html
    http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/Memor yManagementRules.html
    Article on leaks
    http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instrume nts/

  • Question about navigation

    Is it possible to have a navigation menu to switch between different portals(dashboards) to have different iviews appearing for different departments in a company?
    The dashboard has different departments, so for example, the director would need to switch from the IT department to the HR department and so on... each user would have access to different dashboards which contain different iviews... and there is some kind of a navigation menu that would show it... or maybe just show the next and the previous possible
    dashboard that we can jump to in the tree? any suggestions would be appreciated,
    thank you

    i don't see any reason why it would not be possible? it is one of the portals basic feature?
    BTW, this is XI forum, u may want to post in portal forum?

  • Question about the Create Session Bean Wizard

    Hi,
    I'm using the Session Bean Wizard to generate a session facade in EJB 3.0. In step 2 «choose methods to expose through this facade», I only see 2 methods generated for each entity: findAll and remove.
    When I click Help on this page, the documentation specify the following:
    «Use the tree control to specify the core methods and entity methods you want to generate. Core Facade Methods Theese methods are used for basic CRUD (create, read, update, delete) functionality. »
    So why is the wizard only offering to generate findAll and remove?
    Also the remove method generated does not seem to delete anything as in the following :
    public void removeDcaRole(DcaRole dcaRole) {
    final EntityManager em = getEntityManager();
    try {
    final EntityTransaction et = em.getTransaction();
    try {
    et.begin();
    dcaRole = em.find(DcaRole.class, new DcaRolePK(dcaRole.getDcaNo(), dcaRole.getTRoleCode()));
    et.commit(); // where is the delete ???
    } finally {
    if (et != null && et.isActive()) {
    et.rollback();
    } finally {
    if (em != null && em.isOpen()) {
    em.close();
    Can I use the remove method as a starting point to an update ?
    Any comment on this would be appreciated.

    There are update and insert methods under the "core" section/
    See this image : http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/images/b20105.gif
    You might want to follow this tutorial to see how it works:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm#t4

  • Random question about navigating with the keyboard

    When I'm in the Finder on my work computer (10.5.x), I can hold the Apple key, and hold the up arrow, and I'll keep going up a level in a folder, until I'm at the hard drive root.
    I use this as a quick way to jump up a bunch of levels in a folder.
    On my home computer (10.6.4), when I do the same keystroke, I only go up one level and it stops.
    I have to release the up arrow and hit it repeatedly.
    Is this a change in 10.5 to 10.6, or is it some preference that's set somewhere?

    AFAIK, that's controlled by Finder->Preferences->General->uncheck Always open folders in new window and CMD+up arrow will cycle up to the top folder. Check it and CMD+up arrow opens a new window, requiring you to use the keys again. I prefer what you don't like. HTH

  • Question about navigating the Web

    Sometimes when I want to go 'back' to a previous page on the Net a box comes up and asks if I'm sure I want to do this....I can't remember the exact wording. Can someone tell me what this means?

    "+That will happen if you have entered some data on a web page, then use Back, before the data has been sent. It is warning you that anything you typed into the page will be lost."+
    All of you contributed to that statement, which makes perfect sense. When I'd get that message, "Are you sure", I hadn't noticed that I'd probably backed out of a form I either filled in or intended to but didn't fill in. As a matter of fact, when I copied the statement above, then hit "Reply", the box to reply was there but because I wasn't sure I'd copied the words correctly I clicked to go 'back' to copy them again, and there was the box asking me if I was 'sure' I wanted to do that. I had proof of the truth of the above statement in short order! Never have I received such a good and true answer! Thanks so much!

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Question about scope!!

    Hi ~
    I have a question about scope.
    for example
    primitive character variable ("char")
    what is principle upon which it is based?
    How can scope implemented?
    Please explain at low level in detail..
    thanks

    Scopes are related to braces (and the for+catch-statements).
    Inside a function nested scopes of the same name are forbidden {int x; {int x; ... } ...}, as misunderstanding could arise.
    You may mention a name (method name, class name, var name), before its declaration, like:
    int f() {x = 3;} int x;Implementation issues address variable locations on the stack and heap management (garbage collection), and exceptions (stack unwinding).
    If you are interested in compiler construction try the javap tool, and try out the JVM, by for instance writing a compiler to JVM byte code.
    To answer your question on variable clean-up: I'm afraid while playing compiler you need to calculate var addresses/frame sizes, and calls/stack frames are a bit confusing, but the rest is easy.

  • Question about session variables and binding

    Hi All,
    I'm a newbie with Application Express. I've gone through several tutorials and a book, and now I'm actually getting started with apex. My first adventure is a tiny little form, where all you do is fill it out and it sends an email. Pretty simple.
    And, i have it working just fine - but I have a question about something I don't quite understand. Basically, I am generating the email text in a page process. And some of the form fields work fine if i reference them as *:ACCT_NAME*, but some give me the dreaded "not all variables bound" error. For the ones that give me the error, I can reference them like V('ACCT_NAME').
    So, as a newbie, I'm a little confused. When is it appropriate to use the V function, and when it is appropriate to use binding? Why would one of the fields work with binding but not another from the same form?
    Thanks for any clarification you can offer,
    Lisa

    Lisa,
    A bind variable is a place holder variable available in an environment.It is used quite frequently(outside Apex Context) in SQL and PLSQL scripts and especially in Dynamic SQL statements.Many times using a bind variable gives better performance. In the Apex environment,page items and many other variables related to the session are available as bind variables and hence their value can be referred in SQL,PLSQL contexts as :VARIABLE_NAME.
    Now V() function is an apex specific function which returns the value of an apex session variable outside the apex environment. So as Machaan pointed out, it is used in
    procedures and triggers that gets called from within an apex session. This is required since the bind variables themselves are not directly available in the SQL environment but their values from the corresponding session can be accessed by this apex built-in function.
    The length of any Bind variable name is limited to 30 characters, this is a limitation inherited from Oracle SQL itself and hence session variables(page or application items) whose name has a length which exceeds 30 characters cannot be used as the :ITEM_NAME format. In such cases you would have to use the v() method again. This might be happening in your case.

  • A question about the IE management of session id

    Hi, guys! I have a question about the IE browser management of session id.
    As we know, firefox browser will use cookie to record session id, so if we delete the cookie files then the client can't find target session.
    But it's not the same as IE browser.I found I already can find target session after I delete the cookies.
    Then I think maybe IE browser use URL rewrite mechanism(GET request) and hidden text mechanism(POST request), but I'm not sure!
    Or maybe IE browser use current IE window process's cache to record the session id?
    Please help me, thank you very much in advance!
    I'm Chinese, my English is so bad, please understand, thanks.

    Thank you for your answer, but I still have a question.
    Can you tell me how your deleting cookies works? I just use IE browser tools->Internet Options->Delete Cookies to delete my cookie, but the session still can be retrieved! Just like you said, the session id is kept in the memory.
    But if I use firefox to do the same operations, the session will can't be retrieved.Does that mean firefox not only delete cookies' files but also delete them in the memory.
    Can I use IE browser to do the same effect as firefox browser? And how to do? Thank you.

  • Problem with beans in session scope

    Hello,
    I developped a website using JSP/Tomcat and I can't figure out how to fix this problem.
    I am using beans in session scope to know when a user is actualy logged in or not and to make some basic informations about him avaible to the pages. I then add those beans to an application scope bean that manages the users, letting me know how many are logged in, etc... I store the user beans in a Vector list.
    The problem is that the session beans never seem to be destroyed. I made a logout page which use <jsp:remove/> but all it does is to remove the bean from the scope and not actualy destroying it. I have to notify the application bean that the session is terminated so I manualy remove it from its vector list.
    But when a user just leave the site without using the logout option, it becomes a problem. Is there a way to actualy tell when a session bean is being destroyed ? I tried to check with my application bean if there are null beans in the list but it never happens, the user bean always stays in memory.
    Is there actualy a way for me to notify the application bean when the user quits the website without using the logout link ? Or is the whole design flawed ?
    Thanks in advance.
    Nicolas Jaccard

    I understand I could create a listener even with my current setup Correct, you configure listeners in web.xml and they are applicable to a whole web application irrespective of whether you use jsp or servlets or both. SessionListeners would fire when a session was created or when a session is about to be dropped.
    but I do not know how I could get a reference of the application bean in >question. Any hint ?From your earlier post, I understand that you add a UserBean to a session and then the UserBean to a vector stoed in application scope.
    Something like below,
    UserBean user = new UserBean();
    //set  bean in session scope.
    session.setAttribute("user", user);
    //add bean to a Vector stored in application scope.
    Vector v = (Vector)(getServletContext().getAttribute("userList"));
    v.add(user);If you have done it in the above fashion, you realize, dont you, that its the same object that's added to both the session and to the vector stored in application scope.
    So in your sessionDestroyed() method of your HttpSessionListener implementation,
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now remove the object from the Vector passing in the reference to the object retrieved from the Session.
            v.removeElement(user);
    }That's it.
    Another approach would be to remove the User based on a unique identifier. Let's assume each User has a unique id (If your User has no such feature, you could still add one and set the user id to the session id that the user is associated with)
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get the unique id of the user object
           String id = user.getId();
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now iterate all user objects in the Vector
           for(Iterator itr = v.iterator(); itr.hasNext()) {
                   User user = (User)itr.next();               
                    if(user.getId().equals(id)) {
                           //if user's id is same as id of user retrieved from session
                           //remove the object
                           itr.remove();
    }Hope that helps,
    ram.

Maybe you are looking for

  • HttpURLConnection.connect() takes long time (3 minutes)

    I'm stumped on an unusual problem. I'm running java 1.3 and Apache JServ (don't ask, I inherited this set up), using JSSE. One of the things we do with our app involves some xml communication over SSL. Starting last week, the time for the SSL communi

  • Search Help for Position in Custom infotype

    Dear All, I had created one Custom Infotype in which one field is Position which is same as position in Infotype 0001. The search help should be same. How can i achieve this? Here i had attached search help in PS structure of the custom infotype but

  • Preview Problem when converting .jpg to .pdf

    My scanner isn't producing sharp enough images, so I am: 1. Saving the 300 dpi scanned file in .jpg format 2. Opening the .jpg file in Preview. 3. Sharpening the image. 4. Saving the .jpg file as a .pdf file. But Preview saves the .pdf file with huge

  • New window help - newbie :(

    i found this script here, but I am a newbie and I cant figure out how to put in a "yes" to scrollbars. Can anyone help? on (release) { url=" http://yahoo.com"; winName="newName"; w="400"; h="400"; getURL ("javascript:n_name=window.open('"+url+"','"+w

  • Infoset query with cero values

    Hi I have an infoset query that reads the information from an infoset. The infoset query is able to read the values, because it shows me values, but everything is cero, although I have values different from 0. But if it didn`t find values it would te