jsp - sharing Session managed bean between 2 web projects with websphere extension -
We have to use the same session in 2 different web modules using the WebPier extension in the same project. To get a session from a web module in other web modules < P> Common Project ER Project Web Project 1 Web Project 2
- We The WebSpace extension has been implemented for your project
- In our web project 1 first.jsp is the code from which we are sending the code - getFacesContext (). GetExternalContext (). GetSessionMap () Put ("key", common session bean); 4. In our web project 2, there is sec.jsp in which we are getting sessions. Code - getFacesContext () GetExternalContext (). GetSessionMap () Obtain ("key"); The above code returns an object, but we need a normal session so the object returned to us is typed in the normal session type
- Now when we run first.jsp on the server, we get an error
java.lang.ClassCastException: common.session.Sess with common anomaly. Try changing the AAR Classloader policy to APPLICATION and use the Singleton Pattern, or you can use Distributed You can use the map (), which is specific to WebSpace but can provide a very powerful map-like interface for object storage and retrieval.
Comments
Post a Comment