request « Session « Java Enterprise Q&A





1. Using request.getSession() as a locking object?    stackoverflow.com

I have some java code that gets and sets a session attribute:

Object obj = session.getAttribute(TEST_ATTR);
if (obj==null) {
  obj = new MyObject();
  session.setAttribute(obj);
}
In order to make this code thread-safe, I'd ...

2. Is there only one way to get session in java calling request.getSession()?    stackoverflow.com

Hi I like to know is there only one way to call session using request.getSession() or is there any other way?

3. Problem initiating SIP session/ getClientTransaction(request) throws NullPointerException    stackoverflow.com

I have a small issue, I had my SIP client working, and I changed the structure of the code. I kept the creation process of the SIP objects as it was ...

4. How Can I Retrieve The Session Id from a Jax RS Webservice?    stackoverflow.com

I cannot figure out how to retrieve the session id from a given jax rs web service request. I assume it is available, but do not know how to retrieve it. ...

5. Parent of session object: request or application    stackoverflow.com

Its an interview question: What is the parent of session object? As per scope(in image below) my answer is : application enter image description here But, the answer was ...

6. Java Request.isRequestedSessionValid() still true after session expires    stackoverflow.com

I am using Spring Security 3.0 and created a custom filter to check for expired sessions. My problem is that request.isRequestedSessionValid() returns true in my filter even after I let the session ...

7. Get session by id in ajax call    stackoverflow.com

Is there a way to have access to session in a AJAX call made to a JAVA server. On the server, the request object has both the session and cookies properties ...

8. Request, Session and Application Beans    forums.netbeans.org

I do not understand the request, session and application beans functionality created automatically by Netbeans when you create a new Visual Web JSF page in your web project. Netbeans only create those beans the first time I create a Visual Web Jsf Page. What is the relation between the backing bean of the web page and thouse beans? Should exist more ...

9. multiple requests with uniquely generated session ids    jmeter.512774.n5.nabble.com

I have an XML-based API I am load testing that consists 2 or more page requests that require a session id that is unique across sessions. A session id can be generated and used for each request in that session, or if none is given on the first request one will be returned that must be used for subsequent requests in ...





10. Session ID changes for a POST request    jmeter.512774.n5.nabble.com

Hi all, I've been getting problems with Session ID's. I've added a HTTP cookie manager, which seems to have resolved most of my problems, but I@ve come across an instance where the session ID is not being passed correctly to the URL. ie GET request #1: ...

12. Can we sent request after session timeout ?    coderanch.com

My question is: I have a DoSomethingServlet to created a MyBean object and put it into session object, then DoSomethingServlet foward request to showMyBean.jsp page the show the result. At the beginning of showMyBean.jsp I coded the following: ============ <%if(session.getAttribute("myBean") != null){ myBean = (MyBean)session.getAttribute("myBean"); if(myBean == null){ System.out.println("The sessin object is null now") %>

13. setAttribute() for session object and setAttribute() for request object??    coderanch.com

Originally posted by darine darine: What is the difference of using setAttribute for session object and setAttribute for request ServletRequest ?? when do we use this over using that and in which cases? The difference is the scope, i.e., the lifetime of your attribute. Session-scoped attributes remain visible as long as your client's session remains valid; you would use it to ...

14. object storing in session or request    coderanch.com

It really depends on how long you want objects to hang about. If you really only want then for the length of the request then use request scope if they need to live for the length of the session then session. Also from the sounds of what you are doing a bean might be a better way to store the information ...

15. Requests and Sessions    coderanch.com

My question is in regard to loosing information due to objects being in the request scope or the session scope. If I have some objects that hold important information and I end up using a request scope to hold them. Lets say it is a customerObject. I then go forward 2 pages. I later on decide I want to back track ...

16. A question about Request Vs Session    coderanch.com

Hi guys. I have a question about using request.setAttribute and request.getAttribute. Say for example I have an online book store with different categories (drama,sci-fi,etc). If the user clicks on a particular category, the servlet will fetch all the records that match the category_name, will create a bean with all the book properties and put this bean in a vector. In other ...





17. pass via request or session object?    coderanch.com

18. session.setAttribute vs request.setAttribute    coderanch.com

The basic difference between these 2 methods is the scope or lifetime of the attribute you are setting. If you set an attribute on the request it is only available for that specific request. If you set it on the session it is available for that request and all subsequent requests by the user using the session (i.e. until the session ...

19. setting attributes to session vs. to request    coderanch.com

Basically setting an attribute to a request can only be accessed by the request whereas the session attribute can be accessed between multiple requests. A good example would be a shopping cart - the users shopping items could be stored in the session. Within this application, if a form needs to be submitted (e.g. you have a page that requests user ...

20. Basic question about request and session    coderanch.com

as far as i know... session object lives from the moment that the user logins till logout which invalidates the session. next, request object is only instantiated whenever the user submits a form. and request object is short-lived.. and request object is heavier than the session object since a request contains session object. am i right to say that?

21. what is session and new request    coderanch.com

Dear sir I would like to know what is session. when does it created, when it is destroyed. also i would like to know that when a new request is created for a page. well supose i have created a LoginUser.html page in within context root newctx which accept userId and password as the name sugest for this page then i ...

22. Why does it take 2 requests to set session attribute?    coderanch.com

I have a servlet filter and it checks the session to see if an object exists. If it doesn't, it creates it and saves it to the session and then works with the object. When I make the first request from a browser, it properly says it's null and then lets me set it (and a "getAttribute" check shows it's been ...

23. session.setAttribute and request.setAttribute, what's the diff?    coderanch.com

The difference is called the "scope". If you put a variable in a request, it will disappear when the request is over. If you put a variable in a user session, it will disappear when the session is over. When do you use one, rather than the other ? It depends on what you want to do. You may need a ...

24. To put in the session or in the request ?    coderanch.com

Hi. I have a a question that I really want to know how the right answer. Consider the following scenario : The user clicks on the following link : /details.do?isbn=1234567 The action goes to the database (throught Hibernate) and gets the required item and put it in the session scope and forwards the request to details.jsp page. details.jsp has 'Add to ...

25. Is request.getSession() the only way to get session?    coderanch.com

When you get to the section that covers event listeners the concept of event objects should become more clear. There was, in the past, an object called SessionContext that held references to all of the sessions. It allowed you to fetch one by ID. For security reasons, it's been deprecated. These days, with listeners, it's easy to duplicate this functionality yourself ...

26. Who was right about using request filter to validate session?    coderanch.com

At work, a requirement came in to handle session timeouts gracefully across our entire application. Some of our application does so already. But for the screens that are not, I suggested that the tean implement a request filter to validate the session on every request since that was in essence what the requirement called for. I heard back later from the ...

27. Related to Session and Request objects    coderanch.com

We fetch the session object from the request object. Then what is the difference between request and session? Why cant I use the request itself instead of session? Is it that session can be fetched from request object only? Or is there any other way to get the session object? Somebody please explain. Regards, Sriram

28. Session management on server to server requests.    coderanch.com

I am doing server to server authentication and I am running into some trouble with session management. Let me try and describe I have a login method and a filter where we check the user id and password against values stored in our database. If the id and pwd match, we create a user object and store it into session. I ...

29. session without request    coderanch.com

I think my question will not be possible but i am standing in that scenario. Container is tomcat 6. Is there any way to get the session object without the help of request in the servlet or any model class from tomcat? Reason is, there is a class which was used in more then 500 other class(utility class). currently i need ...

31. Sessions and requests    coderanch.com

Hi All, I hope this is the correct forum for these questions. 1. Do HTTPRequest and xmlHTTPRequests from a users browser page share the same session? 2. If so, can race conditions occur whereby an xmlHTTPRequest can start processing before an HTTPResponse has returned? i.e. Could one browser tab send an xmlHTTPRequest shopping cart change of item while another tab is ...

32. request object from session id    coderanch.com

33. how can I put a value in Request or session?    forums.oracle.com

34. Request Times out after 30 mins. How to have keep the session alive    forums.oracle.com

All, I have some pages which take more than 30 mins to send the response back after sending the request. The web server has the time out value set at 30 minutes. We dont want to change that value. Its required to keep the session active during the time the request is sent and response is received. Can someone suggest how ...

36. getting session without request object    forums.oracle.com