context « API « JSP-Servlet Q&A





1. Java - Setting context attributes (ServletContextListener)    stackoverflow.com

I read a properties-file at the webapplication startup phase (contextInitialized()) and I started to think about how to make these settings 'visible' to the servlets. Do I need to loop through ...

2. Problem in Context Listener    stackoverflow.com

I was trying to run a servlet using ServletContextListener ,I've put the codes from the book "Head-First" writter "Kathy sierra", but this is not working.Its shows 404 error.I have put the class ...

3. Can we call getServletContext() inside contextInialized method?    stackoverflow.com

Creating servlet that implments contextInializer interface in this code, then accessing file inside contextinialized() using this line

InputStream input = getServletContext().getResourceAsStream("/WEB-INF/file.properties"));
this exception occurred
java.lang.NullPointerException         ...

4. Servlet context serializable attribute persistence    stackoverflow.com

I set a servlet context attribute, which is an object of Serializable class. Does it persist after application server restart as session attributes do?

5. is there any way to restrict acess to an attribute in servlet context    stackoverflow.com

I need to change the value of an object which is in Sevlet context at runtime.it is guaranteed by my application that only a single thread would reset the value of ...

6. Java EE: Is is it wise to make my context attribute thread-safe in this scenario?    stackoverflow.com

I'm implementing a dynamic notification system (a la Facebook) for my website with the help of the Servlet 3.0 API. My planned structure to support this functionality is:

  1. On each page ...

7. different classpath for context    coderanch.com

Hello, I am running an application for multiple clients and the setup is like the set of classes being used are common and the property files are different for each client. The structure looks as below : /usr/local/common_application_classes/ - this folder contains all classes /usr/local/properties/client1/ - this folder contains properties of client1 /usr/local/properties/client2/ - this folder contains properties of client2 ...... ...

9. ServletConfig & Servlet Context    coderanch.com





10. GenericServlet and Context name problem    coderanch.com

11. ServletConfig & Context ?    coderanch.com

Originally posted by Adeel Ansari: [QB] Why?? Is it become free? QB] Certainly lack of funds is a legitimate excuse for not owning Head First books. I just find that so many of the basic questions about Servlets and JSP are answered very, very clearly and simply in that book. For that reason I would recommend a new Java programmer to ...

12. How to store array in servlet context???    coderanch.com

Hello all, I am making an chat application, in which I am mainting the current login list to an array.. which is defined in Chatter.java. Now, I am invoking the addChatter() and getChatter() from that class to add and retrive the currently login user's list... But when I login from another machine, while one is login it doesn't show me the ...

13. Singleton or servlet context attribute    coderanch.com





19. New PortletURL, in context without HttpServletRequest    liferay.com

I need to create a PortletURL in a *ServiceImpl class that points to a create account page. In this context I do not have access to an HttpServletRequest or a PortletRequest instance, which is required by the PortletURLFactoryUtil create method. In this context I do have access to the company and group id that I want the PortletURL to point to. ...