Question

I have a ZK web project that had .zul files with corresponding composers.I am trying to remove .zul files and replacing them by .jsp files.

Please have a look at the following snippet of code and suggest if I can replace them with HttpSession ? Please also let me know if I need to provide further additional information. Any suggestions/feedbacks/guidance would be appreciated.Thanks in advance.

Code Snippet

import org.zkoss.zk.ui.Session;
import org.zkoss.zk.ui.Sessions;

public static void loadUserCustomProperties(String userFolder){
   // Create a properties object with system wide properties as defaults
   Properties userCustomProperties = new Properties(CustomProperties);

  Session session = Sessions.getCurrent();   //Line 5
  session.setAttribute(Constants.USER_PROPERTIES, userCustomProperties);  //Line 6

 }
Was it helpful?

Solution

ZK just wraps the standard Java HTML/HTTP API.

Calling Sessions.getCurrent().getNativeSession() should give you an instance of type HttpSession.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top