object « Context « JSP-Servlet Q&A

1. Why use the ServletContext object in a web-app containing servlets and "worker" threads in Java    stackoverflow.com

I currently have a web-app where I have Servlets reading and writing to the ServletContext attributes and I have "working" Threads (Daemon threads) which get initialized on startup and currently hold ...

2. How to get and set a global object in Java servlet context    stackoverflow.com

I wonder if anyone can advise: I have a scenario where a scheduled job being run by Quartz will update an arraylist of objects every hour. But I need this arraylist ...

3. Context and InitialContext - should I be calling the close() method on these objects?    stackoverflow.com

Had I looked into the Java SE6 documentation sooner on Context and InitialContext, I would've seen that there is a close() method for each. So now I wonder, do I need ...

4. servletcontext object    coderanch.com

5. Objects In Servlet Context    coderanch.com

That's likely to cause some concurrent access isuses, for the beans anyway. If all your beans are application scope, then you should probably synchronize all the public methods. Does the app neccessitate that all your beans are application scope? In my experience, session scope is generally more useful(although not without its own issues!) :roll: Cheers E

6. storing object in servletcontext    coderanch.com

Hi, I am using MVC pattern in my web application, I have a question regarding using context to store my dataoperation object(which handles all the data base related operations). What essentially I am doing is calling my action class from Controller Servlet this action class then uses dataoperation class to perform db calls. For sake of simplicity I have stored dataoperations ...

7. Servlet Context Object?    coderanch.com

8. What happens in Servlet context object    coderanch.com

Please help me about the reference of servlet context object. I have a class MyClass. This object is set to servlet context. ServletContext.setAttribute("MyClass",MyClass); Later in some other request class i have protected void doGet(HTTPREQ,HTTPRES) { myClass = (MyClass)ServletContext.getAttribute("Myclass"); } What happens here when multiple requests come? Will each request have their own instance of MyClass or they all refer to the ...

10. Creation of ServletContext object    coderanch.com

12. ServletContext Object?    coderanch.com