ConvergedHttpSession
The ConvergedHttpSession interface extends javax.servlet.http.HttpSession and provides additional functionality specifically for converged HTTP/SIP containers. In such containers, an HttpSession instance can be cast to a ConvergedHttpSession to access methods designed for converged applications.
This interface is useful when HTTP and SIP interactions are integrated, enabling sharing and management of session attributes across the two protocols. It facilitates unified session management for converged applications by allowing SIP-specific session handling alongside standard HTTP session capabilities.
Methods:
getApplicationSession
SipApplicationSession getApplicationSession()
Retrieves the parent SipApplicationSession associated with the ConvergedHttpSession. If no parent session exists, this method creates a new SipApplicationSession, associates it with the current converged HTTP session, and then returns it.
Returns:
The parent SipApplicationSession associated with this ConvergedHttpSession. If none exists, a new session is created and returned.
encodeURL
java.lang.String encodeURL(java.lang.String url)
Encodes the given HTTP URL with the jsessionid of the current ConvergedHttpSession. The jsessionid is appended in the format ;jsessionid=http-session-id. This ensures session tracking for URLs when cookies are not used.
Parameters:
url: An absolute HTTP URL string to be encoded (e.g., http://server:7001/mywebapp/foo.jsp), where /mywebapp corresponds to the context path of the current ServletContext.
encodeURL
java.lang.String encodeURL(java.lang.String relativePath,
java.lang.String scheme)
Converts the provided relative path into an absolute URL by prepending:
- The context path of the current ServletContext (e.g., /mywebapp),
- The specified scheme ("http" or "https"),
- The host and port of the web server (e.g., server:8888),
and then encodes the resulting URL with the jsessionid.
Parameters:
relativePath: A path relative to the current web application (e.g., "/foo.jsp").
scheme: The scheme to use in the generated URL ("http" or "https").
Returns:
The encoded absolute URL with the jsessionid appended.
Start innovating with Mobius
What's next? Let's talk!