How to store jsp session data of different user in util.hashmap

how to store jsp session data of different user in java.util.hashmap
and access the data of all user on the server side
The same example is given in professional jsp but its not working.
I can use getIds() of httpsessioncontext but it's depricated

Hi
I'm trying to make an example.
With the following codes you can get the date from the session.
request.getSession().getAttribute("sessionname")
To store it in a hashmap you could do it like this ->
Hashmap hm = new Hashmap();
hm.put(Object key, request.getSession().getAttribute("sessionname"));
I hope you understand it if not just write it!
Cyrill

Similar Messages

  • How do I access session data through an EJB?

    Hi
    How do I access session data through an EJB?
    I am currantly developing a Web service (using ejb's, JBoss.net and Apache Axis). A client making a call to this Web service, is expecting a bussiness-object in return. My problem is that this bussiness-object i stored in a users session data. How do I retrieve this bussiness-object from the users session.
    I have read that this does not work with httpsessions, is this true? If this is true, is it possible to store the bussiness object in a JavaBean e.g:
    <jsp:useBean id="userContextWebImpl" scope="session" class="com.ac.march.client.UserContextWebImpl">
    <%
    String key = "test";
    String value = "This is the value";
    userContextWebImpl.setValue( key, value1 );
    %>
    </jsp:useBean>
    and then retrieve this information through the EJB? Or is it possible to do this by using Statfull JavaBeans? Or can this be done through a nother solution?
    Please help!

    I have created a JavaBean with scope="application" to store some data. The data is stored when a user prefomes a spesific task.
    A different person then makes a call to a Web-Service on the server. The Web-Service then asks an EJB to retrieve the data stored in the JavaBean (servlet cotext). In other words: How do I retrieve this data from the EJB?
    I have tried with this code, but with no luck.
    (ApplicationContextWebImpl is the JavaBean)
    public static String getBookingResult( String key )
         String myResult = null;
         String myKey = key;
         ApplicationContextWebImpl applicationContextWebImpl = null;
         try
              applicationContextWebImpl = new ApplicationContextWebImpl();
              myResult = (String)applicationContextWebImpl.getValue( key );
         catch ( java.rmi.RemoteException e )
         return myResult;
    }

  • How to display the header data on different position in alv report

    hi all,
    how to display the header data on different position in alv report.
    for example ,
    customer                                                   name
      xxxx                                                         xxxx
                     vendor        name     street 
                      xxxx         xxxx      xxxxx
    pls   help me .

    hi
    as per my understanding you need to trnasfer header internal table data  to pdf..
    please check the following links for internal table to pdf..
    Convertion of Internal table data to PDF
    This link is related to ur issue
    Re: how to insert the calling of the FM: OTF to PDF
    Thanks

  • How to route incoming file data to different ftp servers?

    Hi all,........its urgent.
        Our client requirement is
    1.they are sending csv file , then the file is to be splitted according to company code and should be routed to particular FTP server.
        But in our case we are using same message type and data type ..hence we are not using Mapping objects..then how to route this incoming data to different FTP servers

    Hi Nandan,
    Use X-Path in your receiver determination.
    What is X-Path
    http://www.w3.org/TR/xpath20/
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    /people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object
    /people/prakash.darji/blog/2006/09/22/using-xpath-statements-within-sap-netweaver-2004s-bex-web-application-designer--part-1
    Regards,
    Sarvesh
    ****Reward points, if found helpfull.

  • Hi I have two questions. I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users? How is the session timeout set? Thanks, YS

     

    <i>I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users?</i>
    Um, there is no such thing as NAS4.1.
    I'm assuming that you mean NAS4.0 (maybe NAS4.0sp1?). If so, then the session timeouts are specified in the session section of the NTV configuration files.
    AFAIK, you can specify session timeouts on a per user basis.

  • How to replicate session data at the user level?

    Hi all,
    my client has users who use laptop/tablet computers in the field with wireless connections. The application requires the users to complete long multi-page forms where the data is only submitted to the EIS layer at the end of the process. The connections regularly drop out which understandably is a cause of some grief. In addition, the users want to be able to switch to another machine in order to complete their session.
    The 'switching machine' requirement kills the idea of using persistent cookies and session replication unfortunately. So I am faced with the idea of storing the session data (keyed by user id), in serialized form, either on a stand-alone disk which is accessible by each webserver in the cluster or is the database. The problem with the database idea is the performance hit of traversing the EJB and JDBC layers.
    Can anyone suggest the best practice in this case? Or point to an article or tool that covers the problem?
    BTW, the app serves a small (<50) and stable base of authenticated users so scalability is not really an issue whereas failover is.
    Regards,
    Dave.

    > Is it possible to close a PO at the header level
    Po can be closed at Item level and not Header level. You can set Deletion Indicator and further can be archived thru SARA MM_EKKO
    or a way to deactivate the PO so that no new items can be added?
    You can activate Release strategy and Choose a Proper Release indicatory so that no new changes to be carried out.
    Else go for User Exits

  • BSP data from different user mixed up

    Hello,
    Our stateful BSP application is called from the portal. How can it be possible that two different users at two different locations with different session id's can see information from the other person?
    Best regards
    Sander

    Hi Sander,
    this can happen if you enable server cache. One user calls the page with his relevant information, then the page is cached and each other user who calls the same page gets the cached one instead of his own page.
    Please have a look at the "Properties" tab of your page and check that the Cache is set to 0 sec.
    Regards,
    Rainer

  • Store the session data temporary

    Hi
    I'm a beginner in JSP, and I started to design a webpage to ebook store site.
    I have a problem with saving the session data , because i didn't want to use data base in may site. and that data will used in the later pages in the web site.
    as example : if the user needed to add more than one item to his\here cart , then all that items must appeared in the page named view cart .
    so please help me.....

    for u store data in a session u have
    Declare session object
    ---HttpSession session =getSession(true);
    session.setAttribute("key",value);
    if u want to the data added in a different u have to just
    Object obj =session.getAttribute("key",value);
    if(obj != null)
    String str =(String)obj;
    System.out.println("value is ===" + str);
    }

  • How to store array of data into a single row of  table ,using any of Stmts

    HI Friends,
    Based on my requirements ,i have retrived a set of data from a XXX.jsp page using a request.getParameter() and stored into single dimenssional array . Now i am paassing that array to JAVA class to store a into some table .
    In JSP page users can add text boxes dynamically based on his intrest then those attributes will store in table .it means table attributes are not conatant , it table attributes may change at any time when user adds any textboxs or any fields on JSP page ....thats my module ..
    Now i wanted to store all array of data into Table in a single row .......thats is my requirements .
    How can we use prepareStatement and Statement to store array of results intoo table row ...on each iteration i wanted to store array of results into table atributes ..It means entire array of results should to into table row at time .....coule any one write sytax ,how we do this...
    could any one suggest me stps that i can impliment ......?....please reply ASAP

    Well ..you code can be works for constant number of attributes in table .oopss here my requirement is table attributes not fixed ,we cant put constant number of place holder(? ) in a statement ,because those are not fixed ,
    Let me explain here :
    i am doing in that way only. As i mentioned you Table attributes are not constant .It may very if users add any fields dynamically on JSP page .If users have option to add any text box on Jsp page ,then that attribute will store in table as a attribute .
    Now i amable fetching the all dyamic form data and stored in a Result Array below ...in this iteration all form result data are from jsp page as suggestion form ,it should stored in table in single row on corrsponding attribtes ......next time when users fills FROM ,then those data i am fetching and storing in a Result Array as below and need to store in corrsponding table attributes in a single row ....
    for(int i=0;i<result.length;i++)
                   System.out.println(result);
                   pst3=connection.prepareStatement("insert into *emprecord* values(?)");
                   if(!result[i].equals(""))
                        System.out.println(result[i]);
                             pst3.setString(1,result[i]);
                             pst3.executeUpdate();
    Thnks in advance ....let me know the the way we can store dynamic form data into dyanamic table ...

  • Help!  Can't figure out how to store the same photo in different events

    I know that this is just a user error problem, but I can't figure out how to store multiple versions of the same photo in different events. For example, I use Aperture as my main photo library, so I have a big folder set-up by year and then by events within those years to organize and maintain my library. I'm currently working on a project where I would like to pull out certain pictures for other uses. I tried creating new events and then moving the pictures to those events (like I would have in iPhoto) expecting for a new version of the picture to be deposited in the new event. That didn't work - it moved the picture out of my "main library" folder and as far as I can see it now only exists in the new event. Next, I tried creating "new versions" of the pictures I wanted to move and then just selecting those and moving them. In one folder I selected three photos, clicked "New Versions", then in the browser display I could see two of each picture (for a total of six), I selected ONE of each photo and moved those three to the new event. At which point all six disappear from the "main library" and end up in my new event. I don't understand why that happens. Currently the only way I've been able to do what I need to do is by using the flag field, but as far as I can tell there is only one of those - it's on or off that is really not serving my purpose. What do I need to do???

    Like Jim said, you most likely want Albums for what you describe. Albums simply consist of "pointers" to a single compilation of image data. Albums can be created and deleted at will, because they are just pointers; an important concept.
    Also learn to use Keywords - and unlearn "folder" organization, which is not the way digital asset management works. The power of Albums and Keywords is huge once we lose the film-think of folders organization.
    HTH
    -Allen Wicks

  • How to store php sessions using memcached and unix socket

    I am running Arch linux with systemd, nginx, and php with php-fpm. I am trying (and failing) to configure memcached to store sessions using a unix socket. I have memcached installed and active, however, I am unable to disable networking. I added the following line to /etc/conf.d/memcached
    MEMCACHED_ARGS="-s unix:///tmp/memcached.sock -a 666"
    I also tried:
    MEMCACHED_ARGS="-s /tmp/memcached.sock -a 666"
    MEMCACHED_ARGS="-s unix:/tmp/memcached.sock -a 666"
    when I restart memcached I always get:
    memcached.service - Memcached Daemon
              Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled)
              Active: active (running) since Sat 2013-01-19 17:41:15 PST; 5min ago
            Main PID: 773 (memcached)
              CGroup: name=systemd:/system/memcached.service
                      └─773 /usr/bin/memcached -l 127.0.0.1
    when I run php script with sessions php error log shows (not surprisingly):
    [19-Jan-2013 16:46:45 America/Los_Angeles] PHP Warning:  Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (unix:/tmp/memcached.sock) in Unknown on line 0
    I also installed the php-memcached package but I don't what it does or how to get it going. I uncommented the following line in /etc/php/conf.d/memcached.ini:
    extension=memcached.so
    but that didn't change anything.
    Any insights or suggestions would be greatly appreciated.

    Look at this link -http://odiexperts.com/getting-one-or-several-unknown-files-from-a-directory
    change the command to fetch the ls command and write into File and then using either java or jython break the data and fetch the file name and date and insert into log table.
    (or)
    you can use the os.system command and get the complete ls command into string and then process and insert it.
    Let us know if you need any other help.

  • How to clear all session data in adf through coding?

    Hi Everyone,
    i have created many pages in an application.I want to clear all session data when i get back to my first page.
    how to do that?
    such that my application should run as i am running for the first time.
    Thanks.

    Hi Jabr,
    i have used this code in initMethod() (Before phase) of my page.
    ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
    HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
    HttpSession session = (HttpSession)ectx.getSession(false);
    session.invalidate();
    this code got executed but the page has 2 lovs.
    im getting error null pointer exception that EmpLovVO not found.
    if i remove the above code then the page is running correctly.
    What to do now?
    Thanks.

  • How to end RDP sessions remotely from different network?

    Hi
    How to end RDP sessions remotely for windows 2008r2 server from different network?
    not from local LAN
    Thanks

    Hi
    what ports need to be open to successfully connect to server behind firewall?
    from WAN to LAN using :
    net use \\servername_or_IP /USER:username “password“
    or
    qwinsta /server:ServerIP
    Thanks

  • How to display rows of data into different columns?

    I'm new to SQL and currently this is what I'm trying to do: 
    Display multiple rows of data into different columns within the same row
    I have a table like this:
        CREATE TABLE TRIPLEG(
            T#              NUMBER(10)      NOT NULL,
            LEG#            NUMBER(2)       NOT NULL,
            DEPARTURE       VARCHAR(30)     NOT NULL,
            DESTINATION     VARCHAR(30)     NOT NULL,
            CONSTRAINT TRIPLEG_PKEY PRIMARY KEY (T#, LEG#),
            CONSTRAINT TRIPLEG_UNIQUE UNIQUE(T#, DEPARTURE, DESTINATION),
            CONSTRAINT TRIPLEG_FKEY1 FOREIGN KEY (T#) REFERENCES TRIP(T#) );
        INSERT INTO TRIPLEG VALUES( 1, 1, 'Sydney', 'Melbourne');
        INSERT INTO TRIPLEG VALUES( 1, 2, 'Melbourne', 'Adelaide');
    The result should be something like this:
    > T#  | ORIGIN  | DESTINATION1  |  DESTINATION2 
    > 1   | SYDNEY  | MELBORUNE     | ADELAIDE
    The query should include the `COUNT(T#) < 3` since I only need to display the records less than 3. How can I achieve the results that I want using relational views???
    Thanks!!!

    T#
    LEG#
    DEPARTURE
    DESTINATION
    1
    1
    Sydney
    Melbourne
    1
    2
    Melbourne
    Adelaide
    1
    3
    Adelaide
    India
    1
    4
    India
    Dubai
    2
    1
    India
    UAE
    2
    2
    UAE
    Germany
    2
    3
    Germany
    USA
    On 11gr2, you may use this :
      SELECT t#,
             REGEXP_REPLACE (
                LISTAGG (departure || '->' || destination, ' ')
                   WITHIN GROUP (ORDER BY t#, leg#),
                '([^ ]+) \1+',
                '\1')
        FROM tripleg
        where leg#<=3
    GROUP BY t#;
    Output:
    1 Sydney->Melbourne->Adelaide->India
    2 India->UAE->Germany->USA
    Cheers,
    Manik.

  • Saving session data for different browsers

    If I open 2 or more Firefox windows the same session data is saved across the browsers, rather than one for each browser window. Is there a way to handle this?

    Not if you are using cookies as the session tracking mechanism.
    Basically Firefox is treating all its windows as being the same internet browsing "session".
    So it shares cookies across all the open windows. IE does a similar thing for windows opened from links, and File:New Window.
    Because the Servlet container keeps track of your session via the "session cookie" that means that your session data is saved across browsers.
    If you disable the cookie session mechanism on the Servlet container (I think you can do that) and just use the urlEncoding rather than cookies to retain the session, you could probably accomplish your goal. However it would be tricky, and the SessionID would be completely visible in the address bar.
    Cheers,
    evnafets

Maybe you are looking for

  • New problem calling PL/SQL based WS from BPEL process

    I have created a webservice based on a PL/SQL package based function with JDeveloper and deployed the web service on the BPEL OC4J server. Calling the web service endpoint directly from internet explorer works fine. I have also created and deployed a

  • Boot Camp, Vista, and Half-Life 2 Episode 2

    I am trying to run Episode 2 on my Mac Pro. When I first tried to launch the program it told me I needed to update the Nvidia 7300 graphics driver, or I could continue with the old driver. I'm thinking now I should have at least tried it with my orig

  • FI Report Painter (FGI1) - add new button in output screen

    Hi all, I have a report created by tcode FGI1 (Create Drill-down Report) which bases on form 0SAPBSPL-01 (Fin. Statement: Actual/Actual Comparison). I wanna know if there are any ways to add a new button in output screen after report execution (i.e t

  • Oracle utilities SDk download

    Hi, Where can I download oracle utilities SDK. Is it licensed? if no can you please send me the url from where can I download SDK?

  • How to run oracle 10g on solaris 10

    hi, i am running oracle10g in windows xp............ but i have installed solaris 10 on my computer and not able to install oracle 10. pls help...... thanks