Pass data structure from PHP to JS
In JS:
var ap_radioMode = unserialize('<?php echo serialize ($ap_radioMode) ?>');
i.e. Use PHP's serialze() and echo out the value, then apply JS's counterpart unserialize() to get the data structure.
In JS:
var ap_radioMode = unserialize('<?php echo serialize ($ap_radioMode) ?>');
Posted by Ginger at 3:32 PM 0 comments
Cookie is sent from web server to the browser as a header, and it is stored in the browser. On all the subsequent requests, the browser would send the cookie data transparently to the server, So it advised to keep the size minimal.
Http Session data is stored in the server, but its session identifier is sent in cookie. In this way, the session reference is passed instead of the actual data to save network traffic. When the user disable the cookie in the browser, URL rewrite (response.encodeUrl) will be used to append jsessionid on url parameters.
When a GET hits the server with no session cookie or id, Tomcat creates a new session and sets the cookie:
Set-Cookie: JSESSIONID=2978A7FABFF3DB35BE622290E1294CDE; Path=/
It then also encodes all URLs on a page with jsessionid. At this point, does not know if the browser supports cookies. So the next GET (with both cookie and URL parameter) is required to decide if cookies are OK or not.
Posted by Ginger at 5:45 PM 0 comments
The JNDI architecture consists of an API and a service provider interface (SPI). Java applications use the JNDI API to access a variety of naming and directory services. The SPI enables a variety of naming and directory services to be plugged in transparently.RMIRegistry is also one type of JNDI provider besides Ldap, File System.
envs.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.rmi.registry.RegistryContextFactory");
envs.put(Context.PROVIDER_URL, "rmi://localhost:1099");
Posted by Ginger at 5:39 PM 0 comments