com.ibm.ws.webcontainer.httpsession.SessionInspectServlet
servlet that you can use to investigate what content is stored in HttpSession of your application. The SessionInspectServlet will tell you- Names of the session attributes
- Size of the data in session attribute
- If the attribute is serializable or not
You might want to use this when you start getting NotSerializableException or you run into performance issue due to size of data stored in session.
You can follow these steps to add SessionInspectorServlet to your web application
- Add Session Inspector servlet to web.xml file of your web application
<servlet>
<display-name>SessionInspectServlet</display-name>
<servlet-name>SessionInspectServlet</servlet-name>
<servlet-class>com.ibm.ws.webcontainer.httpsession.SessionInspectServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SessionInspectServlet</servlet-name>
<url-pattern>/SessionInspectServlet</url-pattern>
</servlet-mapping>
You dont have to include any jars in your web application. If you search for SessionInspectServlet class you will notice that it is part of WebSphere/AppServer/plugins/com.ibm.ws.webcontainer_2.0.0.jar, which is websphere runtime so you can use that class without including it in your web application - Install and start your web application on server
- Access the SessionInspectorServlet by going to /webcontext/SessionInspectorServlet url
This is the output that i get for my webapplication, i am storing object of Contact class in session that does not implement Serializable interface and a String, String is serializable
Website Development Company in Delhi & Web Designing Company in Gurgaon.
ReplyDelete