What should we find in a regular JSF session?

Today I noticed that there is more session on the map than me.

Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
Iterator attributeNames = sessionMap.keySet().iterator(); 
while ( attributeNames.hasNext() ){
  System.out.println(attributeNames.next().toString());
}

In my session, two unknown objects were found: com.sun.faces.application.view.activeViewMapsand javax.faces.request.charset. Is it normal to find these objects in a session?

I ask about this because it com.sun.faces.application.view.activeViewMapsgives me serialization errors when rebooting the server. He seems to be trying to serialize almost everything.

Note. I know that I can disable serialization by uncommenting <Manager pathname="" />in the server file context.xml. I just want to know if it’s ok to find com.sun.faces.application.view.activeViewMapsin a session.

+4
source share
1 answer

Yes, it’s normal to search in a session:

com.sun.faces.application.view.activeViewMaps

JSF 2.2.0, com.sun.faces.application.view.ViewScopeContextManager CDI @ViewScoped beans ACTIVE_VIEW_MAPS (ACTIVE_VIEW_MAPS - , "com.sun.faces.application.view.activeViewMaps"), .

, , sessionDestroyed(HttpSessionEvent hse) grepcode.com.

javax.faces.request.charset:

JSF public String calculateCharacterEncoding(FacesContext context) ViewHandler, :

, .

.

  • Content-Type. charset, .
  • charset , , ExternalContext.getSession(boolean) false . true, ExternalContext.getSessionMap() , CHARACTER_ENCODING_KEY. , , .
  • null

CHARACTER_ENCODING_KEY :

, .

, : "javax.faces.request.charset"

+7

All Articles