Servlets store information on the server side?

i am working on a tapestry web app.
is there a way for servlets to store some information on the server side independently. like a http session is visible to only the user who is viewing it, somebody else cannot view somebody elses http session details. but is there a way to share some common information inbetween all user sessions/pages. i dont want to store any info within the db but somewhere within tomcat.
i hope i am able to express my question properly.

I am a little confused when you say:
A user logs onto the server and a new web application is started for him then another user logs on from another place and a new web application is started for that user.
If they are hitting the same servlet in the same context (directory under your root webapps folder) then there is one web application. Each user is just starting a new session in that one web application. Each user is not creating a new web application.
That being said, and if it is true (all the users are using the same servlets) then you should use the ServletContext to store data you want to share between users. That is what it is designed for. In Servlets (and JSPs) you can talk about four different scopes where data gets stored in a particular application:
1) The 'page' scope is relevant only to JSPs, and represents data that is visible only to the current JSP page for the current user. The object used is called PageContext.
2) The 'request' scope stores data available to all servlets accessed by a single user through a single request (so if forwards, or includes are used to get from one servlet to another). The ServletRequest object is used to store this data.
3) The 'session' scope stores data available to a single user across multiple requests. The HttpSession object stores this info.
4) The 'application' scope stores data available to all users across all requests. The ServletContext object stores this info.
All of the scopes have data stored/retrieved via setAttribute(key,value) and getAttribute(key) methods.
"cant i maintain a list of users who are generating or viewing a web app from my server at any instance"
Yes you can. I would use a SessionListener to listen for when new sessions are created. When they are get the information you need and add them to a list in the ServletContext where all users can see it. Then in the SessionListener listen for when a session is destroyed, and remove the user from the list.

Similar Messages

  • Refreshing the Servlet on the Server side???

    Hi,
    Can we refresh a servlet page on the server side without using response.sendRedirect()???

    Hello,
    I just had a look at www.pushlets.com, looks an interesting idea, and relatively easy to do.
    Correct me if I am wrong, but the examples I looked at were not reloading the page, rather, they create a page that takes a long time to load, and keep streaming more data to it.
    What they are doing is putting the thread to sleep, so the page never loads fully, instead continually updating.
    The problems with this would seem to be that you could append more data to the page, but not be able to delete information already in the browser.
    I am also unsure what would happen in the event the user closes the browser, I assume the jsp would keep trying to send data until the session expired.

  • Why the server side behavior of LoadVars() not consistent?

    In my server side script for FMS app,there is such code:
    var lv = new LoadVars();
    var params = new LoadVars();
    lv.send("http://mysite.com/registerVideo.php", params, "POST");
    The expected behavior is that the request will be as if sent directly from the browser,thus SESSION information is not lost ,which is the exact behavior for my computer.
    But it's not the case for my boss --- session information is lost for him.
    Why the server side behavior of LoadVars() not consistent?
    What do I need to do to make sure session information is not lost @ server side ?

    Oops,why this feature has always worked like charm for me only??
    Below is the server side request caught from firebug:
    POST registerVideo.php
    http://mysite.net/registerVideo.php
    200 OK
    mysite.net
    115ms
    ParamsHeadersPostPutResponseCacheHTML
    Response Headersview source
    Server
    nginx/0.7.67
    Date
    Tue, 29 Mar 2011 14:45:31 GMT
    Content-Type
    text/html
    Transfer-Encoding
    chunked
    Connection
    keep-alive
    Vary
    Accept-Encoding
    X-Powered-By
    PHP/5.2.14
    Expires
    Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control
    no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma
    no-cache
    Content-Encoding
    gzip
    Request Headersview source
    Host
    mysite.net
    User-Agent
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.13) Gecko/20100914 Firefox/3.5.13
    Accept
    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language
    en-us,en;q=0.5
    Accept-Encoding
    gzip,deflate
    Accept-Charset
    ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive
    300
    Connection
    keep-alive
    Cookie
    pass=angel333; user=liying123; PHPSESSID=8m966mbd070tsdqqodnncesbj5
    Source
    Referer: http://mysite.net/flash/main.swf?sessionId=8m966mbd070tsdqqodnncesbj5 Content-type: application/x-www-form-urlencoded Content-length: 35 name=test&record=live&action=insert

  • How to delete the server side sessions

    Hi All,
    I have a wireless application and it is accessed through ptg/rm gateway from a PDA browser. Oracle wireless AS gives default login page (when the application is accessed through ptg/rm gateway) and when user login, user information session might get stored in server side (I am not sure, if any one can pls clarify me on this also?).
    Now i have a requirement, in which my application user should get 'logoff' button in each and every page of my application. When he clicks on this button the user information session should get invalidated, so that even if the user goes back to the application (using back button of the browser) he should not able to enter the application. (This is same as any std. login/logout page logic).
    Invalidating the session which resides in client side is easy (By using session.invalide()), but how can i delete the session which resides on the server side??? Whether is it possible??
    If yes then how can i do it.
    Any help will be very usefull.
    Thanks well in adavance.
    Shrikant

    Shrikant:
    Shouldn't it be easy to invalidate the server sided sessions? Right before invalidating the client side session, send a message to the server, which should call its session.invalidate() after it has obtained the current session. If desired, a message can be sent back to the browser informing user that server side session has been deleted.

  • Error getting the server-side naming service functionality

    Hi all,
    we are currently setting up the CTS+ activity based transport scenario. Everything seems to be working fine, however, we have to import each transport twice...
    Before I go into detail in the error we get I will first describe our landscape. All the configuration we did was done in debate with SAP.
    We use the SAP Solution manager (ehp1 SP 4) as the CTS+ server as recommended by SAP and have an NWDI system of which we only use the components DTR and CBS (since CMS is not used anymore in the activity based transport). We have defined three logical ports/RFCs. CTSCONFIG points to the NWDI system. CTSDEPLOY is running on the java stack of the solution manager and is only used for portal content (=epa) transports. CTSDEPLOY_DI is pointing to the NWDI system and is used for all NWDI (=dip) changes. The NWDI is running ehp1 SP3.
    In STMS I defined all the non-abap systems (and configured them to use CTSDEPLOY_DI) and created the following transport route:
    upload system (IMP) -> DEV -> ACC -> QAS -> PRD
    I first attached the used dependencies in a transport request (SAP_BUILDT, EP_BUILDT, etc) these imported just fine. Then I did the SCA files which contain our custom code. I extracted these from the assemble step on our current NWDI system which will be removed as soon as we switch to the new CTS+ environment.
    When we import the transport into the runtime systems then we see the DTR and CBS be filled sucesfully for this specific system. However, the transport request itself always fails with errorcode 12 and the error is:
    Error during export service registration: Error getting the server-side naming service functionality during getInitialContext opera
    tion. com.sap.engine.services.jndi.persistent.exceptions.NamingException: Error getting the server-side naming service functionality during getInitialContext operation.
    Error in execution of Web services CTSDEPLOY_DI , exception is cx_cts_file_import_failed
    File import canceled
    When we then reimport the same transport it will go the second time fine. This is no problem during the setup but will not be workable when we go live ofcourse. Is there anyone who had this issue before as well and have a solution for it?
    Kind Regards,
    Nico van der Linden...

    Hello Nico,
    I would need the java trace files to get more info on this issue, but you can start troubleshooting this error with these notes:
    #1172252: CTS+, 'attach file': Troubleshooting Guide;
    #1003674: Enhancement for non-ABAP systems in CTS;
    #1155884: CTS+, configuration 'close coupling': Troubleshooting guide;
    Pay special attention to parameter  NON_ABAP_WBO_CLIENT, whether it's correctly set on your CTS+ system(s).
    Note #1003674 is a must for any CTS+ systems to work properly, as well as having an updated version of the transport programs (tp and R3trans).
    Lastly, note #1155884 goes through some JCoException exceptions that commonly take place during CTS+ transports. But again, you need to check the underlying trace files to find the root cause of your issue.
    I hope this information helps.
    Best regards,
    Tomas Black

  • Font management from the server-side

    In the process of creating Breacrumbs for our website
    redesign, the Graphics Designer would like to use a special fonts.
    We already know that this font will not be installed on most of
    user client-side. She though about creating graphics to represents
    the navigation (breadcrumbs) but I ask myself if we can use the
    Font Management from the Coldfusion Administrator. I have no
    experience with this feature and have not find interesting
    information about it from the web.
    Is it possible to use a font installed on the server-side
    through CSS so the client/web-user will see the text with that
    font?

    You could use WEFT, but it is still limited to certain
    browsers.
    http://www.microsoft.com/typography/web/embedding/weft3/
    Bitstream has something to , but again, is limited
    http://bitstream.com/

  • How to tell client disconection reason when invoke disconnect() on the server side.

    Is there any way to tell client the reason for disconect when I call disconect() on the server side. its some way like using error object as optional parameter to include reject reason when invode rejectConnection

    Ignore the JSRs for now.
    Follow the JavaEE tutorial.
    http://docs.oracle.com/javaee/6/tutorial/doc/
    The answers to many of your questions will be clear to you once you have completed the tutorial.
    I also like the tutorials here (they are a little dated, but still mostly relevant as the core JEE6 specs that the tutorial relies on were released over 5 years ago and JEE7 is yet to be released).
    https://schuchert.wikispaces.com/EJB+3+and+Java+Persistence+API
    zonski has a spring+javafx focused tutorial if you would prefer to learn and use Spring than JEE (they are differing technologies which cover pretty much the same functional set):
    http://www.zenjava.com/series/building-jee-applications-in-javafx-2-0/
    JavaFX is a client side framework so there is not much you would do with it on the server side.
    It seems like there is a ton of "JSR's" for different tasks, and I'm not sure exactly what I need, and all that, so I'm really confusedNobody needs all of JEE, just use the bits that you want that are a good fit for whatever project you are doing - don't try to use everything at once.
    A lot of the stuff can be learnt and used in isolation.
    Selected relevant topics, might be (in the order that I would consider them):
    Persistence: http://docs.oracle.com/javaee/6/tutorial/doc/bnbpy.html
    Java Servlet Technology: http://docs.oracle.com/javaee/6/tutorial/doc/bnafd.html
    JAX-RS web services: http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html
    Contexts and Dependency Injection: http://docs.oracle.com/javaee/6/tutorial/doc/gjbnr.html
    Enterprise Beans: http://docs.oracle.com/javaee/6/tutorial/doc/bnblr.html

  • Needs a background webdynpro application running at the server side

    Hi All,
    We have a requirement wherein we need to have an application running all the time at the server side to capture the response coming from a web application. Based on the response that the application receives, it needs to update some backend R/3 tables.
    We are thinking of a webdynpro java application.
    Can anyone suggest what kind of application needs to be implemented here?
    And what  would be the steps required to run the application at the server side without calling the application.
    Thanks & Regards,
    Anurag

    Hi Robin,
    Thanks for the detailed explaination.
    This may sound silly to you but I've another doubt which is as follows:
    As you mentioned that the external web application will be sending requests to our Web service(in SOAP envelopes) and rest of the functionality can be  achieved by our web service.
    Actually, we are expecting only responses from the external web application. The thing is that we are sending the requests to the external web applications from our custom webdynpro application and in return the web application will be sending us 2 responses.
    First response would be back to our WD java application URL(to the browser in which WD java app is running) which would get the response and display some message based on the response.
    Second would be to this web service which you have just suggested. We are having two responses so that even if the browser in which the WD java application is running gets accidentally closed, the response from the external web application must get captured somewhere else and should not get lost in any case.
    So, now since we are only expecting the response from the web application and we do not want any requests from the web application to our web service; how is this possible?
    I am asking the above question because you have mentioned that the external web application has to request our Web service but we want is only this web service to capture the response coming from the Web application.
    Or is it like the web application will send us the response string as request string to our Web Service and the web service will capture these response parameters as request parameters from the web application and do the further processing.
    But in that case, we do not want any response to be sent by the Web Service to the external web application.
    Please suggest if this is possible.
    Once again, many thanks for the help so far.
    Thanks & Regards,
    Anurag

  • Bw web report plugin http session hangs at the server side

    Hi,
    I am having problems when closing the browser of a BW web report. After I closed the browser by going File->close, I ran SM04 and found out the Plugin HTTP session hangs at the server side.
    How can we terminate the Plugin HTTP session at the server side when user closes the internet browser?
    I did implement a logoff function at my web template, if user clicks on the logoff, the Plugin HTTP session is terminated at server side correctly. But As you know, 50% of time user will close the report by closing the internet browser instead of clicking the logoff. That leaves lots of hanging Plugin HTTP sessions at our server side.
    By the way, we actived our BEX service at the SICF.
    Thanks for help!
    JA

    Hi
    If you want to avoid a blank page with logoff button, add opener=0
    <a href="<SAP_BW_URL CMD='LOG_OFF' ~command='logoff'
    >" onClick="javascript:window.close(opener=0);">Log off</a>
    If you want to close the session via X, use this code:
    create a sapscript function
    function closeSession()
    logoff()
    window.unload=CloseSession()
    However, the Plugin HTTP session isn't killed.
    Regards

  • How can I disable excel addin on the Server side?

    Hi, is there any way to disable excel addin on the server side?
    We want to disable it so that no one can modify or read data in the cube in the production environment, even if he or she had installed the add in. Instead, we provide the Planning data forms as the only interface for end-users to read and write. we do this because the add in is very easy to install and users can read and write data in the cube at their will.
    As we designed to keep the security filters simple, it is not a good idea to controll data access through security filters.
    so, what i'm asking is how to disable excel addin on the server side?
    Thank you for replying.
    Edited by: user4592285 on 2012-10-18 上午6:48

    Hi,
    As Gurus suggested, you will have to restrict viewing of data through dimension level security.
    Give access of members to users, only which are relevant to users so that they can't view other user's data/members.
    Like give access of members belonging to HR dept only to HR users and give access of Finance dept related members to finance users only.
    Hence HR users will view only HR relevant data and won't be able to view (read or write) finance related data and vice-sa-versa.
    Hope this helps
    Regards
    -SM
    Edited by: 918547 on Oct 18, 2012 8:40 PM

  • How to access a JS changed attribute on the server side?

    hi all;
    if i change an attribute on a custom component via java script on the client side.
    how can i access the changed value on the server side?
    in what method will i have the access to this changed field?
    thanks in advance.

    You can hardcode the ID of the component in the backingbean (or some propertiesfile) and use ViewRoot.findComponent(componentId). Using the binding is (much!) more elegant anyway.

  • What's wrong about  "JSF that emits Ajax-widgets" on the server side?

    Hi,
    I just read this chat about Ajax on the server side and I wonder what this comment bellow means when we are building JSF application with Ajax:
    Another thing to consider is that in a pure Ajax application (i.e. one that's not a hybrid of a server-side technology like JSF that emits Ajax-widgets), the server can pretty much just respond to requests from the Ajax client in a stateless manner, and all of the state gets distributed to the client, greatly reducing the memory resources on the server. I'm working on an app like this for IBM Rational and we're really excited about the *decreased* load on the server by distributing state to clients.
    http://www.devwebsphere.com/devwebsphere/2006/04/ajax_and_its_im.html
    Thanks in advance.

    Just created a half an hour ago application:
    http://jsfbyexamples.com/facesTrace/
    shows that the AJAX request spends less time on the server even it walk though the whole life-cycle. This is a very small page, BTW. On the complicated page, the difference will be more significant. It is about server resources.
    About network traffic: Do you actually believe that sending the whole page produces less traffic than the portion updates? Just mathematically speaking?
    OK, I guess you mean the AJAX application requires traffic comes back and forward to produce the AJAX functionality. Non-AJAX application does not produce the traffic, but it does not produce the functionality you have in the first case.
    People who argue about it just try to compare Something to Nothing. So, where is the point?
    Sergey : http://jsfTutorials.net

  • Is it possible to downsize a large image on the server side (before serving it to the user)?

    One of the banes of my existence is resizing the same image several times because of the various contexts it appears in. For example, the main image in an article will appear bigger than it will on the index page, where many article teasers are placed. Then there's the image that goes in the Facebook "share" og. Then there's... you get the idea.
    Same image, different contexts, lots of Photoshop resizing, lots of files to keep track of... but I save on bandwidth.
    On the flip side, I can target the same (large) image and simply downsize via traditional HTML (width/height) on the browser end, but that will mean downloading a file that is 50-75% larger than what is actually needed. If the front page teaser displays a 1280px image at 500px, that's a huge (and potentially costly) waste of bandwidth.
    HOWEVER...
    If I could do the same thing on the SERVER side... in other words, tell the server to take only the pixels it needs from the (large) image and serve only THOSE to the end user... then the same image could be used in each and every context, and only the necessary bandwidth is used.
    Is this do-able? If so, what is the process formally called, and where would I begin to learn how to do it?
    Thanks!

    That's amazing. I didn't think it was possible without saving files on the server first.
    This will suit my needs just fine, but allow me to push my luck even further with the following "hail mary" question : would it be possible for the server to serve the PNG with a width of 100% of the container? In other words, the behavior would mimic width=100% but the server would still only serve as many bytes as are needed to fill that space.
    Not only would I not have to create separate files for every resize (we fixed that problem with your suggestion) but I wouldn't even have to customize every link to a specific size.
    I'm not expecting an affirmative on this one, but it was worth asking. =)

  • Sing a PDF document on the server side

    Hi all, i make on the server side a pdf document automaticly with php. Now I want make an script or a programm that automaticly signs my pdf dokumets.
    Do anyone know more about this scripts or programms in Java, that is running on a server?
    Best regards
    Nikolay

    When I sing, it is usually Girls On Film or Hungry Like The Wolf but I know that Percy Blakney has a fondness for Haircut 100.
    Hope That Helps.
    Oh, and by the way, try doing a search on Google. You'll get quite a few results back for Java and PDF, tovarisch.

  • Retrieving free/busy information from the server takes very long time

    Hello, we are running Outlook 2010 32-bit in Windows 7 64.bit, and  have encountered a strange problem, whenever we want to book
    a resource (i.e. conference room) from Scheduling assistant, it takes very long time, sometimes even more than a minute to see the utilization of the room, it being stuck at "Updating schedule information. Retrieving free/busy information from the server"
    The interesting thing is that most newly deployed PCs exhibits this same behavior, while older machines with basically the same setup gets the availability information almost immediately.
    It is unclear whether this is a server setting or desktop issue, as all new Windows 7/Outlook machines that are deployed from the WDS-server exhibits the same slow behavior.
    Please advise any troubleshooting steps to investigate the very slow retrieval lookup of free/busy information from the Exchange server.

    Hi,
    Does this issue occur on OWA?
    If no, it means the issue is mainly related to the Outlook client.
    Regards,
    Simon Wu
    TechNet Community Support

Maybe you are looking for

  • MIGRAÇÃO DE TAXBRJ PARA TAXBRA

    Boa tarde Sres Como todos sabem  a SAP liberou a nota Note 1538088 - Tax calculation in Brazil recomendando fortemente o uso/migração para TAXBRA. Note 1538088 - Tax calculation in Brazil Na nossa empresas ainda temos TAXBRJ, no resto estamos bem atu

  • Need help setting up site-to-site VPN between two ASA 5505's

    We have been pulling our hair outtrying to solve this. Below is the running configs for both Sites. We have always used Junipers prior to this. It does not appear that the tunnel is getting created. Any help would be greatly appreciated Basic Network

  • Spool - PDF - Binary - EMail as an attachment

    Hi all, I have a classical report output that I need to send as a PDF attachment in an e-mail. I am converting the spool to PDF using FM CONVERT_ABAPSPOOLJOB_2_PDF. I have a bespoke e-mail framework that recognizes the data only in Binary format. And

  • Premiere Elements 4 Crashes in Vista

    Trying to start a project ... I haven't even gotten all of my video clips put down yet and the application randomly crashes!! Totally frustrating. I'm looking for any guidance whatsoever ..... Adobe Support only takes calls M-F 9-5 .... conflicts wit

  • Vector in session

    Hi I am passing vector in session between two jsp's In the first jsp I have session.setAttribute("serialnumber_Vect",serialno_Vect); In the recieving jsp I have the following Vector serial_Vect = (Vector)session.getAttribute("serialnumber_Vect"); But